diff --git a/agent/agent.go b/agent/agent.go index e65cc384..9cdb2701 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -549,7 +549,7 @@ func createConnectionSpan(ctx context.Context, conn net.Conn, op string) opentra tags := opentracing.Tags{ "span.kind": "connection", - "addr": remoteAddress, + "addr": remoteAddress, } var parent opentracing.SpanContext @@ -663,7 +663,7 @@ func (a *agentImpl) reportChannelSize() { logger.Log.Warnf("chSend is at maximum capacity") } for _, mr := range a.metricsReporters { - if err := mr.ReportGauge(metrics.ChannelCapacity, map[string]string{"channel": "agent_chsend"}, float64(chSendCapacity)); err != nil { + if err := mr.ReportHistogram(metrics.ChannelCapacity, map[string]string{"channel": "agent_chsend"}, float64(chSendCapacity)); err != nil { logger.Log.Warnf("failed to report chSend channel capaacity: %s", err.Error()) } } diff --git a/metrics/prometheus_reporter.go b/metrics/prometheus_reporter.go index 1fe26a7c..c071f6bc 100644 --- a/metrics/prometheus_reporter.go +++ b/metrics/prometheus_reporter.go @@ -188,12 +188,13 @@ func (p *PrometheusReporter) registerMetrics( append([]string{"type"}, additionalLabelsKeys...), ) - p.gaugeReportersMap[ChannelCapacity] = prometheus.NewGaugeVec( - prometheus.GaugeOpts{ + p.histogramReportersMap[ChannelCapacity] = prometheus.NewHistogramVec( + prometheus.HistogramOpts{ Namespace: "pitaya", Subsystem: "channel", Name: ChannelCapacity, Help: "the available capacity of the channel", + Buckets: []float64{0, 1, 10, 50, 100, 250, 500, 750, 1000, 1500, 2000, 3000, 4000, 5000}, ConstLabels: constLabels, }, append([]string{"channel"}, additionalLabelsKeys...),