Skip to content

Commit b92ee83

Browse files
Merge branch 'k8s-otel-attribute-standardizing' into staging-only-request-changes
2 parents 7189d38 + f562c1b commit b92ee83

21 files changed

+302
-310
lines changed

entity-types/infra-container/definition.yml

+6-96
Original file line numberDiff line numberDiff line change
@@ -42,21 +42,21 @@ synthesis:
4242
separator: ":"
4343
attributes:
4444
- k8s.cluster.name
45-
- namespace
46-
- pod
47-
- container
45+
- k8s.namespace.name
46+
- k8s.pod.name
47+
- k8s.container.name
4848
encodeIdentifierInGUID: true
4949
name: container
5050
conditions:
5151
# kube-state-metrics container prefix
5252
- attribute: metricName
5353
prefix: kube_pod_container_
5454
# identifier attributes
55-
- attribute: container
55+
- attribute: k8s.container.name
5656
present: true
57-
- attribute: pod
57+
- attribute: k8s.pod.name
5858
present: true
59-
- attribute: namespace
59+
- attribute: k8s.namespace.name
6060
present: true
6161
- attribute: k8s.cluster.name
6262
present: true
@@ -75,94 +75,6 @@ synthesis:
7575
multiValue: false
7676
image:
7777
entityTagNames: [k8s.containerImage]
78-
container:
79-
entityTagNames: [k8s.containerName]
80-
pod:
81-
entityTagNames: [k8s.podName]
82-
namespace:
83-
entityTagNames: [k8s.namespaceName]
84-
k8s.cluster.name:
85-
entityTagNames: [k8s.clusterName]
86-
k8s.deployment.name:
87-
entityTagNames: [k8s.deploymentName]
88-
# cAdvisor data via opentelemetry prometheusReceiver
89-
- compositeIdentifier:
90-
separator: ":"
91-
attributes:
92-
- k8s.cluster.name
93-
- namespace
94-
- pod
95-
- container
96-
encodeIdentifierInGUID: true
97-
name: container
98-
conditions:
99-
# cadvisor container prefix
100-
- attribute: metricName
101-
prefix: container_
102-
# identifier attributes
103-
- attribute: container
104-
present: true
105-
- attribute: pod
106-
present: true
107-
- attribute: namespace
108-
present: true
109-
- attribute: k8s.cluster.name
110-
present: true
111-
# open telemetry
112-
- attribute: newrelic.source
113-
value: 'api.metrics.otlp'
114-
# if service.name is present, handle as one
115-
- attribute: service.name
116-
present: false
117-
# value added for test entities only
118-
- attribute: newrelicOnly
119-
value: "true"
120-
tags:
121-
container:
122-
entityTagNames: [k8s.containerName]
123-
pod:
124-
entityTagNames: [k8s.podName]
125-
namespace:
126-
entityTagNames: [k8s.namespaceName]
127-
k8s.cluster.name:
128-
entityTagNames: [k8s.clusterName]
129-
k8s.node.name:
130-
entityTagNames: [k8s.nodeName]
131-
k8s.deployment.name:
132-
entityTagNames: [k8s.deploymentName]
133-
# kubeletstatsreceiver data via opentelemetry
134-
- compositeIdentifier:
135-
separator: ":"
136-
attributes:
137-
- k8s.cluster.name
138-
- k8s.namespace.name
139-
- k8s.pod.name
140-
- k8s.container.name
141-
encodeIdentifierInGUID: true
142-
name: k8s.container.name
143-
conditions:
144-
# kubeletstats container prefix
145-
- attribute: metricName
146-
prefix: container.
147-
# identifier attributes
148-
- attribute: k8s.container.name
149-
present: true
150-
- attribute: k8s.pod.name
151-
present: true
152-
- attribute: k8s.namespace.name
153-
present: true
154-
- attribute: k8s.cluster.name
155-
present: true
156-
# open telemetry
157-
- attribute: newrelic.source
158-
value: 'api.metrics.otlp'
159-
# if service.name is present, handle as one
160-
- attribute: service.name
161-
present: false
162-
# value added for test entities only
163-
- attribute: newrelicOnly
164-
value: "true"
165-
tags:
16678
k8s.container.name:
16779
entityTagNames: [k8s.containerName]
16880
k8s.pod.name:
@@ -173,8 +85,6 @@ synthesis:
17385
entityTagNames: [k8s.clusterName]
17486
k8s.deployment.name:
17587
entityTagNames: [k8s.deploymentName]
176-
k8s.node.name:
177-
entityTagNames: [k8s.nodeName]
17888
# Docker Container from Samples
17989
- identifier: entityId
18090
name: name

entity-types/infra-container/tests/k8s-cadvisor-via-opentelemetry-prometheus-receiver.json

-37
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,51 @@
11
[
22
{
3+
"instrumentation.provider": "opentelemetry",
4+
"job_label": "kube-state-metrics",
35
"k8s.cluster.name": "farm",
6+
"k8s.container.name": "peach-332",
47
"namespace": "orchards",
58
"pod": "tree-afge",
69
"container": "peach-332",
10+
"k8s.namespace.name": "orchards",
11+
"k8s.pod.name": "spring-tesing-1011",
12+
"kube_pod_container_status_ready": {
13+
"type": "gauge",
14+
"count": 1,
15+
"sum": 1,
16+
"min": 1,
17+
"max": 1,
18+
"latest": 1
19+
},
20+
"metricName": "kube_pod_container_status_ready",
721
"newrelic.source": "api.metrics.otlp",
822
"newrelicOnly": "true",
9-
"metricName": "kube_pod_container_status_ready",
10-
"kube_pod_container_status_ready": {"type":"gauge","count":1,"sum":1.0,"min":1.0,"max":1.0,"latest":1.0},
11-
"k8s.deployment.name": "my-otel-demo-cartservice"
23+
"otel.library.name": "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver",
24+
"otel.library.version": "0.121.0"
1225
},
1326
{
14-
"k8s.cluster.name": "universe",
15-
"namespace": "solar-system",
16-
"pod": "earth",
17-
"container": "verdant-forest",
27+
"container_id": "containerd://101",
28+
"image": "ghcr.io/testing/spring-tesing:latest",
29+
"image_id": "ghcr.io/testing/spring-tesing@sha256:10101",
30+
"image_spec": "ghcr.io/testing/spring-tesing:latest",
31+
"instrumentation.provider": "opentelemetry",
32+
"job_label": "kube-state-metrics",
33+
"k8s.cluster.name": "farm",
34+
"k8s.container.name": "spring-tesing",
35+
"k8s.namespace.name": "default",
36+
"k8s.pod.name": "spring-tesing-1011",
37+
"kube_pod_container_info": {
38+
"type": "gauge",
39+
"count": 1,
40+
"sum": 1,
41+
"min": 1,
42+
"max": 1,
43+
"latest": 1
44+
},
45+
"metricName": "kube_pod_container_info",
1846
"newrelic.source": "api.metrics.otlp",
1947
"newrelicOnly": "true",
20-
"metricName": "kube_pod_container_info",
21-
"kube_pod_container_info": {"type":"gauge","count":1,"sum":1.0,"min":1.0,"max":1.0,"latest":1.0},
22-
"description": "[STABLE] Information about a container in a pod.",
23-
"otel.library.name": "otelcol/prometheusreceiver",
24-
"otel.library.version": "0.91.0",
25-
"instrumentation.provider": "opentelemetry",
26-
"image":"sha256:1f337e7e6242ffe8cb590da7fa41ed409b8f759bcb075767b74d3861c9d25cc0",
27-
"image_id":"gke.gcr.io/foo@sha256:3aaf29f6967aafd47e50007eedc9c2ac78a202a213f43af92e0b9ccfebc63636",
28-
"image_spec":"gke.gcr.io/foo@sha256:3aaf29f6967aafd47e50007eedc9c2ac78a202a213f43af92e0b9ccfebc63636",
29-
"net.host.port": "8080",
30-
"net.host.name": "11.11.1.11",
31-
"service.instance.id": "11.11.1.11:8080",
32-
"http.scheme": "http",
33-
"container_id": "containerd://b413084f553d6c30d4f96e7ceeef60d858ec9dbce93d93d945afd15398fb5f0d",
34-
"k8s.deployment.name": "my-otel-demo-adservice"
35-
}
36-
]
48+
"otel.library.name": "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver",
49+
"otel.library.version": "0.121.0"
50+
}
51+
]

entity-types/infra-container/tests/k8s-kubeletstats-opentelemetry.json

-32
This file was deleted.

entity-types/infra-host/definition.yml

-37
Original file line numberDiff line numberDiff line change
@@ -21,43 +21,6 @@ goldenTags:
2121
- cloud.platform
2222
synthesis:
2323
rules:
24-
# opentelemetry host data from k8s-otel-collector
25-
- identifier: k8s.node.name
26-
name: k8s.node.name
27-
legacyFeatures:
28-
overrideGuidType: true
29-
encodeIdentifierInGUID: true
30-
conditions:
31-
- attribute: k8s.node.name
32-
present: true
33-
- attribute: eventType
34-
value: Metric
35-
- attribute: metricName
36-
prefix: system.
37-
- attribute: newrelic.source
38-
value: 'api.metrics.otlp'
39-
# if service.name is present, it's a service, not a host
40-
- attribute: service.name
41-
present: false
42-
# if container.id is present, it's a container, not a host
43-
- attribute: container.id
44-
present: false
45-
# value added for test entities only
46-
- attribute: newrelicOnly
47-
value: "true"
48-
tags:
49-
k8s.cluster.name:
50-
cloud.provider:
51-
cloud.account.id:
52-
cloud.region:
53-
cloud.availability_zone:
54-
cloud.platform:
55-
host.type:
56-
host.arch:
57-
host.image.name:
58-
host.image.id:
59-
host.image.version:
60-
instrumentation.provider:
6124
# opentelemetry host data from opentelemetry-collector
6225
- identifier: host.id
6326
name: host.name

entity-types/infra-kubernetes_cronjob/definition.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@ synthesis:
1818
separator: ":"
1919
attributes:
2020
- k8s.cluster.name
21-
- namespace
22-
- cronjob
21+
- k8s.namespace.name
22+
- k8s.cronjob.name
2323
encodeIdentifierInGUID: true
2424
name: cronjob
2525
conditions:
2626
# kube-state-metrics cronjob prefix
2727
- attribute: metricName
2828
prefix: kube_cronjob_
2929
# identifier attributes
30-
- attribute: cronjob
30+
- attribute: k8s.cronjob.name
3131
present: true
32-
- attribute: namespace
32+
- attribute: k8s.namespace.name
3333
present: true
3434
- attribute: k8s.cluster.name
3535
present: true
@@ -43,9 +43,9 @@ synthesis:
4343
- attribute: newrelicOnly
4444
value: "true"
4545
tags:
46-
cronjob:
46+
k8s.cronjob.name:
4747
entityTagNames: [k8s.cronjobName]
48-
namespace:
48+
k8s.namespace.name:
4949
entityTagNames: [k8s.namespaceName]
5050
k8s.cluster.name:
5151
entityTagNames: [k8s.clusterName]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[
2+
{
3+
"instrumentation.provider": "opentelemetry",
4+
"job_label": "kube-state-metrics",
5+
"k8s.cluster.name": "farm",
6+
"k8s.namespace.name": "tree",
7+
"k8s.cronjob.name": "apple-tree-cronjob",
8+
"kube_cronjob_created": {
9+
"type": "gauge",
10+
"count": 1,
11+
"sum": 1,
12+
"min": 1,
13+
"max": 1,
14+
"latest": 1
15+
},
16+
"metricName": "kube_cronjob_created",
17+
"newrelic.source": "api.metrics.otlp",
18+
"newrelicOnly": "true",
19+
"otel.library.name": "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver",
20+
"otel.library.version": "0.121.0"
21+
}
22+
]

0 commit comments

Comments
 (0)