Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't drop instance and job labels from the Prometheus receiver #2964

Closed
wants to merge 8 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions receiver/prometheusreceiver/internal/metricsbuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,22 +159,19 @@ func (b *metricBuilder) Build() ([]*metricspb.Metric, int, int, error) {
// TODO: move the following helper functions to a proper place, as they are not called directly in this go file

func isUsefulLabel(mType metricspb.MetricDescriptor_Type, labelKey string) bool {
result := false
switch labelKey {
case model.MetricNameLabel:
case model.InstanceLabel:
case model.SchemeLabel:
case model.MetricsPathLabel:
case model.JobLabel:
case model.BucketLabel:
result = mType != metricspb.MetricDescriptor_GAUGE_DISTRIBUTION &&
return mType != metricspb.MetricDescriptor_GAUGE_DISTRIBUTION &&
mType != metricspb.MetricDescriptor_CUMULATIVE_DISTRIBUTION
case model.QuantileLabel:
result = mType != metricspb.MetricDescriptor_SUMMARY
return mType != metricspb.MetricDescriptor_SUMMARY
default:
result = true
return true
}
return result
return false
}

// dpgSignature is used to create a key for data complexValue belong to a same group of a metric family
Expand Down