Remove common labels from MetricDescriptor #144
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves: #141
Metric proto previously allowed Labels in 2 places: in the MetricDescriptor and in each DataPoint.
The semantics is that Labels in MetricDescriptor apply to all DataPoints.
This requires complicated and expensive merging of Labels maps (which
possibly is made even more expensive since they are stored as lists,
requiring either intermediary data structures or O(nm) merging) when performing
translations from OTLP to other formats that have no equivalent notion of
having label keys per data point and per group of data points (e.g. OpenCensus).
This commit removes Labels from MetricDescriptor. My understanding is that
there is currently no client library that emits MetricDescriptor with labels
so this is not used and can be safely removed.
This will simplify and make faster translation code in the Collector.
If this is needed we can think carefully about adding it back after there
is a clear justification and tradeoffs are well understood.