Skip to content

Commit 61b534d

Browse files
committed
add docs
1 parent d4dc77d commit 61b534d

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

.chloggen/operator-resource-attributes.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ subtext: |
1010
If you are using the file log receiver, you can now create the same resource attributes as traces (via OTLP) received
1111
from an application instrumented with the OpenTelemetry Operator -
1212
simply by adding the `extract: { operator_rules: { enabled: true } }` configuration to the `k8sattributesprocessor` processor.
13+
See the [documentation](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/processor/k8sattributesprocessor/README.md#config-example) for more details.

processor/k8sattributesprocessor/README.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,10 +272,19 @@ k8sattributes/2:
272272
- k8s.node.name
273273
- k8s.pod.start_time
274274
labels:
275-
# This label extraction rule takes the value 'app.kubernetes.io/component' label and maps it to the 'app.label.component' attribute which will be added to the associated resources
276-
- tag_name: app.label.component
277-
key: app.kubernetes.io/component
278-
from: pod
275+
# This label extraction rule takes the value 'app.kubernetes.io/component' label and maps it to the 'app.label.component' attribute which will be added to the associated resources
276+
- tag_name: app.label.component
277+
key: app.kubernetes.io/component
278+
from: pod
279+
operator_rules:
280+
# Apply the operator rules - see https://github.com/open-telemetry/opentelemetry-operator#configure-resource-attributes
281+
enabled: true
282+
# Also translate the following labels to the specified resource attributes:
283+
# app.kubernetes.io/name => service.name
284+
# app.kubernetes.io/version => service.version
285+
# app.kubernetes.io/part-of => service.namespace
286+
# This setting is ignored if 'enabled' is set to false
287+
labels: true
279288
pod_association:
280289
- sources:
281290
# This rule associates all resources containing the 'k8s.pod.ip' attribute with the matching pods. If this attribute is not present in the resource, this rule will not be able to find the matching pod.

0 commit comments

Comments
 (0)