mirror of https://github.com/status-im/consul.git
telemetry: only emit leader cert expiry metrics on the servers
This commit is contained in:
parent
7fe60e5989
commit
7948720bbb
|
@ -22,7 +22,7 @@ import (
|
||||||
var metricsKeyMeshRootCAExpiry = []string{"mesh", "active-root-ca", "expiry"}
|
var metricsKeyMeshRootCAExpiry = []string{"mesh", "active-root-ca", "expiry"}
|
||||||
var metricsKeyMeshActiveSigningCAExpiry = []string{"mesh", "active-signing-ca", "expiry"}
|
var metricsKeyMeshActiveSigningCAExpiry = []string{"mesh", "active-signing-ca", "expiry"}
|
||||||
|
|
||||||
var CertExpirationGauges = []prometheus.GaugeDefinition{
|
var LeaderCertExpirationGauges = []prometheus.GaugeDefinition{
|
||||||
{
|
{
|
||||||
Name: metricsKeyMeshRootCAExpiry,
|
Name: metricsKeyMeshRootCAExpiry,
|
||||||
Help: "Seconds until the service mesh root certificate expires. Updated every hour",
|
Help: "Seconds until the service mesh root certificate expires. Updated every hour",
|
||||||
|
@ -31,6 +31,9 @@ var CertExpirationGauges = []prometheus.GaugeDefinition{
|
||||||
Name: metricsKeyMeshActiveSigningCAExpiry,
|
Name: metricsKeyMeshActiveSigningCAExpiry,
|
||||||
Help: "Seconds until the service mesh signing certificate expires. Updated every hour",
|
Help: "Seconds until the service mesh signing certificate expires. Updated every hour",
|
||||||
},
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
var AgentCertExpirationGauges = []prometheus.GaugeDefinition{
|
||||||
{
|
{
|
||||||
Name: metricsKeyAgentTLSCertExpiry,
|
Name: metricsKeyAgentTLSCertExpiry,
|
||||||
Help: "Seconds until the agent tls certificate expires. Updated every hour",
|
Help: "Seconds until the agent tls certificate expires. Updated every hour",
|
||||||
|
|
|
@ -211,14 +211,16 @@ func getPrometheusDefs(cfg lib.TelemetryConfig, isServer bool) ([]prometheus.Gau
|
||||||
xds.StatsGauges,
|
xds.StatsGauges,
|
||||||
usagemetrics.Gauges,
|
usagemetrics.Gauges,
|
||||||
consul.ReplicationGauges,
|
consul.ReplicationGauges,
|
||||||
consul.CertExpirationGauges,
|
consul.AgentCertExpirationGauges,
|
||||||
Gauges,
|
Gauges,
|
||||||
raftGauges,
|
raftGauges,
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(ffmmm): conditionally add only leader specific metrics to gauges, counters, summaries, etc
|
// TODO(ffmmm): conditionally add only leader specific metrics to gauges, counters, summaries, etc
|
||||||
if isServer {
|
if isServer {
|
||||||
gauges = append(gauges, consul.AutopilotGauges)
|
gauges = append(gauges,
|
||||||
|
consul.AutopilotGauges,
|
||||||
|
consul.LeaderCertExpirationGauges)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Flatten definitions
|
// Flatten definitions
|
||||||
|
|
Loading…
Reference in New Issue