-
Notifications
You must be signed in to change notification settings - Fork 41.4k
Closed
Labels
type: regressionA regression from a previous releaseA regression from a previous release
Milestone
Description
It seems that 3.3.0 introduced a regression during the migration of Prometheus 1.x: exemplars are missing from _count
time series.
I think there are two bugs that are causing this:
- It seems
PrometheusPropertiesConfigAdapter
does not respect the Micrometer defaults for "Prometheus Properties" (these) when there are no user-defined custom properties set:Lines 65 to 74 in 82d8222
private Properties fromPropertiesMap(PrometheusProperties prometheusProperties) { Map<String, String> map = prometheusProperties.getProperties(); if (map.isEmpty()) { return null; } Properties properties = PrometheusConfig.super.prometheusProperties(); properties = (properties != null) ? properties : new Properties(); properties.putAll(map); return properties; }
It seems Micrometer defaults (PrometheusConfig.super.prometheusProperties()
) are only respected and merged with user-defined custom properties when they present, otherwise Micrometer defaults are ignored. This is a problem since Micrometer sets some defaults which can be ignored or not ignored depending on the presence of user-defined properties. - Ignoring Micrometer defaults could have been worked around by manually setting them from user-properties (or by setting any custom Prometheus property) but another bug prevents them to take effect on the exporter. It seems
PrometheusOutputFormat
does not use these properties when it initializes the exporters:Line 81 in 82d8222
private static final ExpositionFormats EXPOSITION_FORMATS = ExpositionFormats.init();
SincePrometheusOutputFormat
callsExpositionFormats.init()
instead ofExpositionFormats.init(ExporterProperties)
, no property set by Micrometer/Boot/user can have any effect on the exporters since they are ignored (in comparison, Micrometer does this).
One workaround could be using the Prometheus property loading mechanism. Adding a prometheus.properties
file to the classpath for example placing it to the resources
folder with the following content brings exemplars on _count
back:
io.prometheus.exporter.exemplarsOnAllMetricTypes=true
In order to reproduce it, you need to ask for the OpenMetrics format from Boot:
http :8080/actuator/prometheus 'Accept: application/openmetrics-text; version=1.0.0' | grep 'trace_id'
and you will need Micrometer's (1.13.x) Prometheus (1.x) registry and Micrometer Tracing: start.spring.io example
Metadata
Metadata
Assignees
Labels
type: regressionA regression from a previous releaseA regression from a previous release