Skip to content

Commit

Permalink
fix code review issues
Browse files Browse the repository at this point in the history
  • Loading branch information
dhontecillas committed Jan 10, 2025
1 parent 1055d68 commit 755d185
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions http/client/transport_metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ type transportMetrics struct {
clientName string
}

type metricFillerFn func(metricsOpts *TransportMetricsOptions, meter metric.Meter, tm *transportMetrics)
type metricFillerFn func(*TransportMetricsOptions, metric.Meter, *transportMetrics)

func noSemConvMetricsFiller(metricsOpts *TransportMetricsOptions, meter metric.Meter, tm *transportMetrics) {
nopMeter := noop.Meter{}
Expand Down Expand Up @@ -137,17 +137,17 @@ func semConv1_27MetricsFiller(metricsOpts *TransportMetricsOptions, meter metric
metric.WithUnit(v127.HTTPClientRequestDurationUnit),
metric.WithDescription("Time spent on TLS negotiation and connection"),
kotelconfig.TimeBucketsOpt)
} else {
tm.requestsStarted, _ = nopMeter.Int64Counter("http.client.request.started.count") // number of reqs started
tm.requestsFailed, _ = nopMeter.Int64Counter("http.client.request.failed.count") // number of reqs failed
tm.requestsCanceled, _ = nopMeter.Int64Counter("http.client.request.canceled.count") // number of canceled requests
tm.requestsTimedOut, _ = nopMeter.Int64Counter("http.client.request.timedout.count") // numer of timedout request (inclued in failed)

tm.responseNoContentLength, _ = nopMeter.Int64Counter("http.client.response.no-content-length")
tm.getConnLatency, _ = nopMeter.Float64Histogram("http.client.request.get-conn.duration")
tm.dnsLatency, _ = nopMeter.Float64Histogram("http.client.request.dns.duration")
tm.tlsLatency, _ = nopMeter.Float64Histogram("http.client.request.tls.duration")
return
}
tm.requestsStarted, _ = nopMeter.Int64Counter("http.client.request.started.count") // number of reqs started
tm.requestsFailed, _ = nopMeter.Int64Counter("http.client.request.failed.count") // number of reqs failed
tm.requestsCanceled, _ = nopMeter.Int64Counter("http.client.request.canceled.count") // number of canceled requests
tm.requestsTimedOut, _ = nopMeter.Int64Counter("http.client.request.timedout.count") // numer of timedout request (inclued in failed)

tm.responseNoContentLength, _ = nopMeter.Int64Counter("http.client.response.no-content-length")
tm.getConnLatency, _ = nopMeter.Float64Histogram("http.client.request.get-conn.duration")
tm.dnsLatency, _ = nopMeter.Float64Histogram("http.client.request.dns.duration")
tm.tlsLatency, _ = nopMeter.Float64Histogram("http.client.request.tls.duration")
}

func newTransportMetrics(metricsOpts *TransportMetricsOptions, meter metric.Meter, clientName string) *transportMetrics {
Expand Down

0 comments on commit 755d185

Please sign in to comment.