Prometheus exemplars autoconfig (#2143)

* Autoconfigure Prometheus Exemplars support

* Tests for autoconfiguration for prometheus exemplars

* Add docs

* Update PrometheusExemplarsAutoConfiguration.java

Co-authored-by: Marcin Grzejszczak <mgrzejszczak@vmware.com>
This commit is contained in:
Jonatan Ivanov
2022-04-12 09:11:48 -07:00
committed by GitHub
parent 5fd8939585
commit 3323115ec0
7 changed files with 287 additions and 0 deletions

View File

@@ -801,3 +801,11 @@ In order to disable this instrumentation set `spring.sleuth.session.enabled` to
This feature is available for all tracer implementations.
We're adding Kotlin Coroutines that allow you to retrieve the current span via the `Tracer` bean. You can either pass the bean to the Kotlin Coroutine context via `Tracer.asContextElement()` method execution or if you have Reactor Kotlin Coroutine integration on the classpath, we will retrieve it from Reactor's context. To retrieve the current span you can call the `currentSpan()` method within the Kotlin Coroutine.
[[sleuth-prometheus-exemplars-integration]]
== Prometheus Exemplars
This feature is available for all tracer implementations.
https://prometheus.io/docs/prometheus/latest/feature_flags/#exemplars-storage[Prometheus Exemplars] are supported through `SpanContextSupplier`. If you use https://micrometer.io[Micrometer], this will be auto-configured for you, but you can register `SpanContextSupplier` directly to Prometheus if you want. +
Please check the https://prometheus.io/docs/prometheus/latest/feature_flags/#exemplars-storage[Prometheus Docs], since this feature needs to be explicitly enabled on Prometheus' side, and it is only supported using the https://github.com/OpenObservability/OpenMetrics/blob/v1.0.0/specification/OpenMetrics.md#exemplars[OpenMetrics] format.