From 61b534d13c0366fc3c533b2d8de287a62b312baa Mon Sep 17 00:00:00 2001 From: Gregor Zeitlinger Date: Fri, 10 Jan 2025 14:08:56 +0100 Subject: [PATCH] add docs --- .chloggen/operator-resource-attributes.yaml | 1 + processor/k8sattributesprocessor/README.md | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.chloggen/operator-resource-attributes.yaml b/.chloggen/operator-resource-attributes.yaml index 38681c76469a..789d52cc5cbf 100644 --- a/.chloggen/operator-resource-attributes.yaml +++ b/.chloggen/operator-resource-attributes.yaml @@ -10,3 +10,4 @@ subtext: | If you are using the file log receiver, you can now create the same resource attributes as traces (via OTLP) received from an application instrumented with the OpenTelemetry Operator - simply by adding the `extract: { operator_rules: { enabled: true } }` configuration to the `k8sattributesprocessor` processor. + See the [documentation](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/processor/k8sattributesprocessor/README.md#config-example) for more details. diff --git a/processor/k8sattributesprocessor/README.md b/processor/k8sattributesprocessor/README.md index ca38d8599ff9..733df48bf8a5 100644 --- a/processor/k8sattributesprocessor/README.md +++ b/processor/k8sattributesprocessor/README.md @@ -272,10 +272,19 @@ k8sattributes/2: - k8s.node.name - k8s.pod.start_time labels: - # 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 - - tag_name: app.label.component - key: app.kubernetes.io/component - from: pod + # 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 + - tag_name: app.label.component + key: app.kubernetes.io/component + from: pod + operator_rules: + # Apply the operator rules - see https://github.com/open-telemetry/opentelemetry-operator#configure-resource-attributes + enabled: true + # Also translate the following labels to the specified resource attributes: + # app.kubernetes.io/name => service.name + # app.kubernetes.io/version => service.version + # app.kubernetes.io/part-of => service.namespace + # This setting is ignored if 'enabled' is set to false + labels: true pod_association: - sources: # 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.