Skip to content

Commit

Permalink
Document metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
boreq committed Nov 20, 2023
1 parent 2cc60dc commit 063961e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ Go-related metrics are available. We also have custom metrics:

- `application_handler_calls_total`
- `application_handler_calls_duration`
- `version`
- `subscription_queue_length`
- `relay_downloader_gauge`
- `relay_connection_state_gauge`
- `received_events_counter`
- `relay_connection_subscriptions_gauge`
- `relay_connection_received_messages_counter`

See `service/adapters/prometheus`.

Expand Down
18 changes: 9 additions & 9 deletions service/adapters/prometheus/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,12 @@ func NewPrometheus(logger logging.Logger) (*Prometheus, error) {
},
[]string{labelHandlerName, labelResult},
)
relayDownloadersGauge := prometheus.NewGauge(
versionGague := prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Name: "relay_downloader_gauge",
Help: "Number of running relay downloaders.",
Name: "version",
Help: "This metric exists just to put a commit label on it.",
},
[]string{labelVcsRevision, labelVcsTime, labelGo},
)
subscriptionQueueLengthGauge := prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Expand All @@ -74,12 +75,11 @@ func NewPrometheus(logger logging.Logger) (*Prometheus, error) {
},
[]string{labelTopic},
)
versionGague := prometheus.NewGaugeVec(
relayDownloadersGauge := prometheus.NewGauge(
prometheus.GaugeOpts{
Name: "version",
Help: "This metric exists just to put a commit label on it.",
Name: "relay_downloader_gauge",
Help: "Number of running relay downloaders.",
},
[]string{labelVcsRevision, labelVcsTime, labelGo},
)
relayConnectionStateGauge := prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Expand Down Expand Up @@ -114,9 +114,9 @@ func NewPrometheus(logger logging.Logger) (*Prometheus, error) {
for _, v := range []prometheus.Collector{
applicationHandlerCallsCounter,
applicationHandlerCallDurationHistogram,
relayDownloadersGauge,
subscriptionQueueLengthGauge,
versionGague,
subscriptionQueueLengthGauge,
relayDownloadersGauge,
relayConnectionStateGauge,
receivedEventsCounter,
relayConnectionSubscriptionsGauge,
Expand Down

0 comments on commit 063961e

Please sign in to comment.