Fix open connections metric

Co-authored-by: Romain <rtribotte@users.noreply.github.com>
This commit is contained in:
mpl 2023-03-20 16:02:06 +01:00 committed by GitHub
parent 598a257ae1
commit 7c2af10bbd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 126 additions and 236 deletions

View file

@ -58,7 +58,8 @@ func RegisterOpenTelemetry(ctx context.Context, config *types.OpenTelemetry) Reg
svcEnabled: config.AddServicesLabels,
configReloadsCounter: newOTLPCounterFrom(meter, configReloadsTotalName, "Config reloads"),
lastConfigReloadSuccessGauge: newOTLPGaugeFrom(meter, configLastReloadSuccessName, "Last config reload success", unit.Milliseconds),
tlsCertsNotAfterTimestampGauge: newOTLPGaugeFrom(meter, tlsCertsNotAfterTimestamp, "Certificate expiration timestamp", unit.Milliseconds),
openConnectionsGauge: newOTLPGaugeFrom(meter, openConnectionsName, "How many open connections exist, by entryPoint and protocol", unit.Dimensionless),
tlsCertsNotAfterTimestampGauge: newOTLPGaugeFrom(meter, tlsCertsNotAfterTimestampName, "Certificate expiration timestamp", unit.Milliseconds),
}
if config.AddEntryPointsLabels {
@ -69,9 +70,6 @@ func RegisterOpenTelemetry(ctx context.Context, config *types.OpenTelemetry) Reg
reg.entryPointReqDurationHistogram, _ = NewHistogramWithScale(newOTLPHistogramFrom(meter, entryPointReqDurationName,
"How long it took to process the request on an entrypoint, partitioned by status code, protocol, and method.",
unit.Milliseconds), time.Second)
reg.entryPointOpenConnsGauge = newOTLPGaugeFrom(meter, entryPointOpenConnsName,
"How many open connections exist on an entrypoint, partitioned by method and protocol.",
unit.Dimensionless)
}
if config.AddRoutersLabels {
@ -82,9 +80,6 @@ func RegisterOpenTelemetry(ctx context.Context, config *types.OpenTelemetry) Reg
reg.routerReqDurationHistogram, _ = NewHistogramWithScale(newOTLPHistogramFrom(meter, routerReqDurationName,
"How long it took to process the request on a router, partitioned by service, status code, protocol, and method.",
unit.Milliseconds), time.Second)
reg.routerOpenConnsGauge = newOTLPGaugeFrom(meter, routerOpenConnsName,
"How many open connections exist on a router, partitioned by service, method, and protocol.",
unit.Dimensionless)
}
if config.AddServicesLabels {
@ -95,9 +90,6 @@ func RegisterOpenTelemetry(ctx context.Context, config *types.OpenTelemetry) Reg
reg.serviceReqDurationHistogram, _ = NewHistogramWithScale(newOTLPHistogramFrom(meter, serviceReqDurationName,
"How long it took to process the request on a service, partitioned by status code, protocol, and method.",
unit.Milliseconds), time.Second)
reg.serviceOpenConnsGauge = newOTLPGaugeFrom(meter, serviceOpenConnsName,
"How many open connections exist on a service, partitioned by method and protocol.",
unit.Dimensionless)
reg.serviceRetriesCounter = newOTLPCounterFrom(meter, serviceRetriesTotalName,
"How many request retries happened on a service.")
reg.serviceServerUpGauge = newOTLPGaugeFrom(meter, serviceServerUpName,