diff --git a/configs/ape.toml b/configs/ape.toml index b494a966..9187a1cd 100644 --- a/configs/ape.toml +++ b/configs/ape.toml @@ -1,7 +1,7 @@ [Agent] # Metrics Serving modes - PROMETHEUS = true - OPEN_TELEMETRY = false + enable_prometheus = true + enable_open_telemetry = false # labels to add to the prometheus metrics for e.g. labels={zone="asia-south1-a", platform="google compute engine"} labels = {latitude="0",longitude="0"} diff --git a/configs/ape.toml.template b/configs/ape.toml.template index 1a68b3d1..260c5e4f 100644 --- a/configs/ape.toml.template +++ b/configs/ape.toml.template @@ -1,7 +1,7 @@ [Agent] # Metrics Serving modes - PROMETHEUS = ${AGENT_PROMETHEUS} - OPEN_TELEMETRY = ${AGENT_OPEN_TELEMETRY} + enable_prometheus = ${AGENT_PROMETHEUS} + enable_open_telemetry = ${AGENT_OPEN_TELEMETRY} # labels to add to the prometheus metrics for e.g. labels={zone="asia-south1-a", platform="google compute engine"} labels = {${METRIC_LABELS}} diff --git a/internal/pkg/config/config.go b/internal/pkg/config/config.go index 4ee1a078..05afd0bf 100644 --- a/internal/pkg/config/config.go +++ b/internal/pkg/config/config.go @@ -15,8 +15,8 @@ var Cfg Config // Config represents the aerospike-prometheus-exporter configuration type Config struct { Agent struct { - OtelEnabled bool `toml:"OPEN_TELEMETRY"` - PrometheusEnabled bool `toml:"PROMETHEUS"` + OtelEnabled bool `toml:"enable_open_telemetry"` + PrometheusEnabled bool `toml:"enable_prometheus"` MetricLabels map[string]string `toml:"labels"` @@ -176,6 +176,10 @@ func (c *Config) ValidateAndUpdate(md toml.MetaData) { c.Agent.Otel.OtelPushInterval = 15 } + if !md.IsDefined("Agent", "enable_prometheus") { + log.Infof("Defaulting to Prometheus Exporting mode") + c.Agent.PrometheusEnabled = true + } } func (c *Config) FetchCloudInfo(md toml.MetaData) {