Skip to content

Commit e6f1024

Browse files
committed
Add job and instance as well-known attribute in prometheus receiver
1 parent 80a415d commit e6f1024

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

receiver/prometheusreceiver/internal/transaction.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@ import (
3636
)
3737

3838
const (
39-
portAttr = "port"
40-
schemeAttr = "scheme"
39+
portAttr = "port"
40+
schemeAttr = "scheme"
41+
jobAttr = "job"
42+
instanceAttr = "instance"
4143

4244
transport = "http"
4345
dataformat = "prometheus"
@@ -227,8 +229,10 @@ func createNodeAndResource(job, instance, scheme string) (*commonpb.Node, *resou
227229
}
228230
resource := &resourcepb.Resource{
229231
Labels: map[string]string{
230-
portAttr: port,
231-
schemeAttr: scheme,
232+
jobAttr: job,
233+
instanceAttr: instance,
234+
portAttr: port,
235+
schemeAttr: scheme,
232236
},
233237
}
234238
return node, resource

0 commit comments

Comments
 (0)