opentracing-contrib / java-metrics

Apache License 2.0
31 stars 9 forks source link

Support 'optional' labels #6

Open objectiser opened 7 years ago

objectiser commented 7 years ago

Enable MetricsLabel to identify whether it is optional.

If supported by a MetricsReporter implementation, then instead of using a default value associated with a MetricsLabel, a label that is marked as being 'optional' can be excluded from being associated with a sampled value.

As discussed in https://github.com/opentracing-contrib/java-metrics/issues/1#issuecomment-308471323, this may apply for some reporter impls when dealing with the error label (i.e. don't add a label of error = false).