-
Notifications
You must be signed in to change notification settings - Fork 941
Description
Exemplars are used to navigate from metrics to example traces. For example, the screenshot shows latencies from the http.server.duration metric as visualized by Grafana. Each little dot represents an Exemplar. If you click on an Exemplar, you can navigate to the corresponding trace.
However, this does not work well if traces are sampled in the collector: In many cases the metric library will choose a Span as an exemplar that will be discarded by the collector during sampling.
It would be good if metric libraries could add a standard Span attribute to indicate that a Span has been selected as an Exemplar. This attribute could be considered by the collector's sampling algorithm to ensure that Exemplars aren't discarded.
A simple way to implement this is adding a boolean attribute, like exemplar="true".
A better way to implement this would be an attribute containing the metric name, like exemplar.metric="http.server.duration". If the attribute is present, it means that the Span is used as an Exemplar. As an additional benefit, the metric name could be used by vendors to allow navigation from a trace to a dashboard showing the corresponding metric.
What do you think?
P.S.: If a Github issue here is the wrong place for this let me know where else to put it.
