Skip to content

Commit

Permalink
update changelog and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
zeitlinger committed Aug 28, 2024
1 parent 2c78774 commit 40466a6
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 11 deletions.
16 changes: 7 additions & 9 deletions .chloggen/resource-attribute-from-annotations.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: enhancement
change_type: breaking

# The name of the component, or a single word describing the area of concern, (e.g. collector, target allocator, auto-instrumentation, opamp, github action)
component: auto-instrumentation

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Add support for k8s labels such as app.kubernetes.io/name and annotations for resource attributes

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

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:
subtext: |
It's a breaking change because these annotations are well-known and widely used in the Kubernetes ecosystem. The following labels are supported:
- `app.kubernetes.io/name` becomes `service.name`
- `app.kubernetes.io/version` becomes `service.version`
- `app.kubernetes.io/part-of` becomes `service.namespace`
- `app.kubernetes.io/instance` becomes `service.instance.id`
28 changes: 26 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ spec:
EOF
```

### Setting instrumentation resource attributes via namespace annotations
### Setting instrumentation resource attributes via annotations and labels

This example shows a pod configuration with OpenTelemetry annotations using the `resource.opentelemetry.io/` prefix. These annotations can be used to add resource attributes to data produced by OpenTelemetry instrumentation.

Expand All @@ -733,7 +733,31 @@ spec:
containers:
- name: main-container
image: your-image:tag
```
```

You can also use labels to set resource attributes.

The following labels are supported:
- `app.kubernetes.io/name` becomes `service.name`
- `app.kubernetes.io/version` becomes `service.version`
- `app.kubernetes.io/part-of` becomes `service.namespace`
- `app.kubernetes.io/instance` becomes `service.instance.id`

```yaml
apiVersion: v1
kind: Pod
metadata:
name: example-pod
labels:
app.kubernetes.io/name: "my-service"
app.kubernetes.io/version: "1.0.0"
app.kubernetes.io/part-of: "shop"
app.kubernetes.io/instance: "my-service-123"
spec:
containers:
- name: main-container
image: your-image:tag
```

## Compatibility matrix

Expand Down

0 comments on commit 40466a6

Please sign in to comment.