Skip to content

Commit

Permalink
Merge pull request #34 from intergral/dist_metrics
Browse files Browse the repository at this point in the history
Dist metrics
  • Loading branch information
Umaaz authored Jul 17, 2023
2 parents e3959d0 + e944a97 commit 2f21fd1
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 17 deletions.
28 changes: 19 additions & 9 deletions modules/distributor/distributor.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,54 +73,64 @@ const (
var (
metricDiscardedSnapshots = promauto.NewCounterVec(prometheus.CounterOpts{
Namespace: "deep",
Subsystem: "distributor",
Name: "discarded_snapshots_total",
Help: "The total number of samples that were discarded.",
}, []string{discardReasonLabel, "tenant"})
metricSnapshotBytesIngested = promauto.NewCounterVec(prometheus.CounterOpts{
Namespace: "deep",
Name: "distributor_snapshot_bytes_received_total",
Subsystem: "distributor",
Name: "snapshot_bytes_received_total",
Help: "The total number of snapshot proto bytes received per tenant",
}, []string{"tenant"})
metricPollBytesIngested = promauto.NewCounterVec(prometheus.CounterOpts{
Namespace: "deep",
Name: "distributor_poll_bytes_received_total",
Subsystem: "distributor",
Name: "poll_bytes_received_total",
Help: "The total number of poll proto bytes received per tenant",
}, []string{"tenant"})
metricPollBytesResponded = promauto.NewCounterVec(prometheus.CounterOpts{
Namespace: "deep",
Name: "distributor_poll_bytes_sent_total",
Subsystem: "distributor",
Name: "poll_bytes_sent_total",
Help: "The total number of poll proto bytes sent in response per tenant",
}, []string{"tenant"})

metricIngesterAppends = promauto.NewCounterVec(prometheus.CounterOpts{
Namespace: "deep",
Name: "distributor_ingester_appends_total",
Subsystem: "distributor",
Name: "ingester_appends_total",
Help: "The total number of batch appends sent to ingesters.",
}, []string{"ingester"})
metricIngesterAppendFailures = promauto.NewCounterVec(prometheus.CounterOpts{
Namespace: "deep",
Name: "distributor_ingester_append_failures_total",
Subsystem: "distributor",
Name: "ingester_append_failures_total",
Help: "The total number of failed batch appends sent to ingesters.",
}, []string{"ingester"})

metricGeneratorPushes = promauto.NewCounterVec(prometheus.CounterOpts{
Namespace: "deep",
Name: "distributor_metrics_generator_pushes_total",
Subsystem: "distributor",
Name: "metrics_generator_pushes_total",
Help: "The total number of span pushes sent to metrics-generators.",
}, []string{"metrics_generator"})
metricGeneratorPushesFailures = promauto.NewCounterVec(prometheus.CounterOpts{
Namespace: "deep",
Name: "distributor_metrics_generator_pushes_failures_total",
Subsystem: "distributor",
Name: "metrics_generator_pushes_failures_total",
Help: "The total number of failed span pushes sent to metrics-generators.",
}, []string{"metrics_generator"})
metricIngesterClients = promauto.NewGauge(prometheus.GaugeOpts{
Namespace: "deep",
Name: "distributor_ingester_clients",
Subsystem: "distributor",
Name: "ingester_clients",
Help: "The current number of ingester clients.",
})
metricGeneratorClients = promauto.NewGauge(prometheus.GaugeOpts{
Namespace: "deep",
Name: "distributor_metrics_generator_clients",
Subsystem: "distributor",
Name: "metrics_generator_clients",
Help: "The current number of metrics-generator clients.",
})
)
Expand Down
6 changes: 4 additions & 2 deletions modules/distributor/forwarder.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,14 @@ const (
var (
metricForwarderPushes = promauto.NewCounterVec(prometheus.CounterOpts{
Namespace: "deep",
Name: "distributor_forwarder_pushes_total",
Subsystem: "distributor",
Name: "forwarder_pushes_total",
Help: "Total number of successful requests queued up for a tenant to the generatorForwarder. This metric is now deprecated in favor of deep_distributor_queue_pushes_total.",
}, []string{"tenant"})
metricForwarderPushesFailures = promauto.NewCounterVec(prometheus.CounterOpts{
Namespace: "deep",
Name: "distributor_forwarder_pushes_failures_total",
Subsystem: "distributor",
Name: "forwarder_pushes_failures_total",
Help: "Total number of failed pushes to the queue for a tenant to the generatorForwarder. This metric is now deprecated in favor of deep_distributor_queue_pushes_failures_total.",
}, []string{"tenant"})
)
Expand Down
18 changes: 12 additions & 6 deletions modules/distributor/snapshotreceiver/reciever.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,36 +45,42 @@ const (
var (
metricPollDuration = promauto.NewHistogram(prometheus.HistogramOpts{
Namespace: "deep",
Name: "distributor_poll_duration_seconds",
Subsystem: "distributor",
Name: "poll_duration_seconds",
Help: "Records the amount of time to poll a config from tracepoint.",
Buckets: prometheus.DefBuckets,
})
metricPushDuration = promauto.NewHistogram(prometheus.HistogramOpts{
Namespace: "deep",
Name: "distributor_push_duration_seconds",
Subsystem: "distributor",
Name: "push_duration_seconds",
Help: "Records the amount of time to push a batch to the ingester.",
Buckets: prometheus.DefBuckets,
})

metricDistributorAccepted = promauto.NewCounterVec(prometheus.CounterOpts{
Namespace: "deep",
Name: "distributor_snapshots_requests",
Subsystem: "distributor",
Name: "snapshots_requests",
Help: "Number of snapshots successfully pushed into the pipeline.",
}, []string{"tenant", "receiver"})
metricPollAccepted = promauto.NewCounterVec(prometheus.CounterOpts{
Namespace: "deep",
Name: "distributor_poll_requests",
Subsystem: "distributor",
Name: "poll_requests",
Help: "Number of completed poll requests.",
}, []string{"tenant", "receiver"})

metricDistributorRefused = promauto.NewCounterVec(prometheus.CounterOpts{
Namespace: "deep",
Name: "distributor_failed_snapshots_requests",
Subsystem: "distributor",
Name: "failed_snapshots_requests",
Help: "Number of snapshots that could not be pushed into the pipeline.",
}, []string{"tenant", "receiver"})
metricPollRefused = promauto.NewCounterVec(prometheus.CounterOpts{
Namespace: "deep",
Name: "distributor_failed_poll_requests",
Subsystem: "distributor",
Name: "failed_poll_requests",
Help: "Number of failed poll requests.",
}, []string{"tenant", "receiver"})
)
Expand Down

0 comments on commit 2f21fd1

Please sign in to comment.
<