Skip to content

Commit

Permalink
[prometheusremotewrite] Export target_info not target (open-telem…
Browse files Browse the repository at this point in the history
  • Loading branch information
gouthamve committed Aug 1, 2022
1 parent 05b1ea4 commit 38347fe
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pkg/translator/prometheusremotewrite/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const (
traceIDKey = "trace_id"
spanIDKey = "span_id"
infoType = "info"
targetMetricName = "target"
targetMetricName = "target_info"
)

type bucketBoundsData struct {
Expand Down
12 changes: 6 additions & 6 deletions pkg/translator/prometheusremotewrite/helper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -478,11 +478,11 @@ func TestAddResourceTargetInfo(t *testing.T) {
resource: testdata.GenerateMetricsNoLibraries().ResourceMetrics().At(0).Resource(),
timestamp: testdata.TestMetricStartTimestamp,
expected: map[string]*prompb.TimeSeries{
"info-__name__-target-resource_attr-resource-attr-val-1": {
"info-__name__-target_info-resource_attr-resource-attr-val-1": {
Labels: []prompb.Label{
{
Name: "__name__",
Value: "target",
Value: "target_info",
},
{
Name: "resource_attr",
Expand All @@ -504,11 +504,11 @@ func TestAddResourceTargetInfo(t *testing.T) {
timestamp: testdata.TestMetricStartTimestamp,
settings: Settings{Namespace: "foo"},
expected: map[string]*prompb.TimeSeries{
"info-__name__-foo_target-resource_attr-resource-attr-val-1": {
"info-__name__-foo_target_info-resource_attr-resource-attr-val-1": {
Labels: []prompb.Label{
{
Name: "__name__",
Value: "foo_target",
Value: "foo_target_info",
},
{
Name: "resource_attr",
Expand All @@ -529,11 +529,11 @@ func TestAddResourceTargetInfo(t *testing.T) {
resource: resourceWithServiceAttrs,
timestamp: testdata.TestMetricStartTimestamp,
expected: map[string]*prompb.TimeSeries{
"info-__name__-target-instance-service-instance-id-job-service-namespace/service-name-resource_attr-resource-attr-val-1": {
"info-__name__-target_info-instance-service-instance-id-job-service-namespace/service-name-resource_attr-resource-attr-val-1": {
Labels: []prompb.Label{
{
Name: "__name__",
Value: "target",
Value: "target_info",
},
{
Name: "instance",
Expand Down
11 changes: 11 additions & 0 deletions unreleased/prometheusrw-exp-export-target-info.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: breaking

# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
component: prometheusremotewriteexporter

# A brief description of the change
note: Export `target_info` not `target` for resource attributes

# One or more tracking issues related to the change
issues: [ 12079 ]

0 comments on commit 38347fe

Please sign in to comment.