Skip to content

Commit

Permalink
[receiver/prometheus] Run TestHonorLabelsTrueConfig again (#9266)
Browse files Browse the repository at this point in the history
Just noticed as I was debugging something else :)

Signed-off-by: Goutham Veeramachaneni <[email protected]>
  • Loading branch information
gouthamve authored Apr 14, 2022
1 parent bf7b2ef commit faf74e4
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions receiver/prometheusreceiver/metrics_receiver_labels_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -571,19 +571,14 @@ func TestHonorLabelsFalseConfig(t *testing.T) {
}

func verifyHonorLabelsTrue(t *testing.T, td *testData, rms []*pmetric.ResourceMetrics) {
//Test for honor_labels: true is skipped. Currently, the Prometheus receiver is unable to support this config
//See: https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/5757
//TODO: Enable this test once issue 5757 is resolved
t.Skip("skipping test for honor_labels true configuration")

require.Greater(t, len(rms), 0, "At least one resource metric should be present")

//job and instance label values should be honored from honorLabelsTarget
expectedAttributes := td.attributes
expectedAttributes.Update("job", pcommon.NewValueString("honor_labels_test"))
expectedAttributes.Update("instance", pcommon.NewValueString("hostname:8080"))
expectedAttributes.Update("host.name", pcommon.NewValueString("hostname"))
expectedAttributes.Update("port", pcommon.NewValueString("8080"))
expectedAttributes.Update("service.name", pcommon.NewValueString("honor_labels_test"))
expectedAttributes.Update("service.instance.id", pcommon.NewValueString("hostname:8080"))
expectedAttributes.Update("net.host.port", pcommon.NewValueString("8080"))
expectedAttributes.Insert("net.host.name", pcommon.NewValueString("hostname"))

metrics1 := rms[0].ScopeMetrics().At(0).Metrics()
ts1 := metrics1.At(0).Gauge().DataPoints().At(0).Timestamp()
Expand Down

0 comments on commit faf74e4

Please sign in to comment.