Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

Commit

Permalink
fix(consul): collect license expiration regardless of agent mode (#1061)
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyam8 authored Jan 23, 2023
1 parent 9b669fc commit 7eebd2f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/consul/collect_metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ func (c *Consul) collectMetricsPrometheus(mx map[string]int64) error {
c.collectGauge(mx, mfs, "raft_fsm_lastRestoreDuration", 1)
c.collectGauge(mx, mfs, "raft_leader_oldestLogAge", 1, "raft_leader_oldestLogAge_oldestLogAge")
c.collectGauge(mx, mfs, "raft_boltdb_freelistBytes", 1, "raft_boltdb_freelistBytes_freelistBytes")
c.collectGauge(mx, mfs, "system_licenseExpiration", 3600, "system_licenseExpiration_licenseExpiration")

if isLeader, ok := c.isLeader(mfs); ok {
if isLeader && !c.hasLeaderCharts {
Expand All @@ -72,6 +71,8 @@ func (c *Consul) collectMetricsPrometheus(mx map[string]int64) error {
}
}

c.collectGauge(mx, mfs, "system_licenseExpiration", 3600, "system_licenseExpiration_licenseExpiration")

c.collectCounter(mx, mfs, "client_rpc", 1)
c.collectCounter(mx, mfs, "client_rpc_exceeded", 1)
c.collectCounter(mx, mfs, "client_rpc_failed", 1)
Expand Down

0 comments on commit 7eebd2f

Please sign in to comment.