diff --git a/agent/consul/leader_metrics.go b/agent/consul/leader_metrics.go index bb65d4dafa..faf8f68eb8 100644 --- a/agent/consul/leader_metrics.go +++ b/agent/consul/leader_metrics.go @@ -22,7 +22,7 @@ import ( var metricsKeyMeshRootCAExpiry = []string{"mesh", "active-root-ca", "expiry"} var metricsKeyMeshActiveSigningCAExpiry = []string{"mesh", "active-signing-ca", "expiry"} -var CertExpirationGauges = []prometheus.GaugeDefinition{ +var LeaderCertExpirationGauges = []prometheus.GaugeDefinition{ { Name: metricsKeyMeshRootCAExpiry, Help: "Seconds until the service mesh root certificate expires. Updated every hour", @@ -31,6 +31,9 @@ var CertExpirationGauges = []prometheus.GaugeDefinition{ Name: metricsKeyMeshActiveSigningCAExpiry, Help: "Seconds until the service mesh signing certificate expires. Updated every hour", }, +} + +var AgentCertExpirationGauges = []prometheus.GaugeDefinition{ { Name: metricsKeyAgentTLSCertExpiry, Help: "Seconds until the agent tls certificate expires. Updated every hour", diff --git a/agent/setup.go b/agent/setup.go index 2db06049bc..9d351547a3 100644 --- a/agent/setup.go +++ b/agent/setup.go @@ -211,14 +211,16 @@ func getPrometheusDefs(cfg lib.TelemetryConfig, isServer bool) ([]prometheus.Gau xds.StatsGauges, usagemetrics.Gauges, consul.ReplicationGauges, - consul.CertExpirationGauges, + consul.AgentCertExpirationGauges, Gauges, raftGauges, } // TODO(ffmmm): conditionally add only leader specific metrics to gauges, counters, summaries, etc if isServer { - gauges = append(gauges, consul.AutopilotGauges) + gauges = append(gauges, + consul.AutopilotGauges, + consul.LeaderCertExpirationGauges) } // Flatten definitions