Skip to content

Add RFC: Instrumentation v1beta1#5079

Merged
pavolloffay merged 10 commits into
open-telemetry:mainfrom
pavolloffay:inst-rfc
Jun 25, 2026
Merged

Add RFC: Instrumentation v1beta1#5079
pavolloffay merged 10 commits into
open-telemetry:mainfrom
pavolloffay:inst-rfc

Conversation

@pavolloffay

@pavolloffay pavolloffay commented May 13, 2026

Copy link
Copy Markdown
Member

Description:

This PR adds RFC for Instrumenation v1beta1

Link to tracking Issue(s):

Related to #5060

Explanation fo managing multiple CRD versions: https://gist.github.com/pavolloffay/e8bf0ad2c42cd94e82f2354a3559894f

Testing:

Documentation:

@swiatekm swiatekm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me overall. I have a major question involving the annotation -> label change, and some minor ones.

Comment thread docs/rfcs/instrumentation-v1beta1.md Outdated
Comment thread docs/rfcs/instrumentation-v1beta1.md
Comment thread docs/rfcs/instrumentation-v1beta1.md
Comment thread docs/rfcs/instrumentation-v1beta1.md
@pavolloffay pavolloffay added the Skip Changelog PRs that do not require a CHANGELOG.md entry label May 18, 2026
@github-actions

github-actions Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

E2E Test Results

 38 files  271 suites   2h 19m 57s ⏱️
115 tests 114 ✅ 1 💤 0 ❌
293 runs  291 ✅ 2 💤 0 ❌

Results for commit 4f08a47.

♻️ This comment has been updated with latest results.

@swiatekm swiatekm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM overall, some questions about the annotation -> label migration.

Comment thread docs/rfcs/instrumentation-v1beta1.md Outdated
#### Deprecation path

1. **v1beta1**: Both labels and annotations supported. Annotations deprecated but functional.
2. **v1alpha1 removal**: Annotations no longer documented, labels become the primary mechanism. Annotations support is eventually dropped.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't fully clear to me. Are we planning to support annotations until we go to v1? Or do they go away with v1alpha1?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have clarified it

  1. v1alpha1 removal: Labels become the primary mechanism. Annotations support is dropped.

Comment thread docs/rfcs/instrumentation-v1beta1.md Outdated
Comment on lines +294 to +306
```yaml
webhooks:
- name: mpod.kb.io
objectSelector:
matchExpressions:
- key: instrumentation.opentelemetry.io/inject-java
operator: Exists
- key: instrumentation.opentelemetry.io/inject-python
operator: Exists
# ... other languages
```

This reduces webhook invocations to only pods that have opted in via labels, improving cluster performance. Pods using legacy annotations will still pass through the webhook (no `objectSelector` match), maintaining backwards compatibility.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only works if we're not supporting annotations, right? So it'll have to be an option in either the kustomize manifests or the Helm Chart.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes it can be only enforced once we don't support annotations. I would give it as opt-in before we fully drop support for the annotation.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some clarification ot the readme.

@jaronoff97 jaronoff97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a few small thoughts, otherwise looks great. thank you Pavol! 🙇

1. Aligns with OpenTelemetry's [declarative configuration](https://github.com/open-telemetry/opentelemetry-configuration) initiative
2. Fixes structural inconsistencies in the current API

## Objectives

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing i think we should also do is let users target specific otelcol CRDs rather than needing to hand write a svc / url. i.e. someone could target namespace/otelcol or something like that and we would validate that the collector exists and then write the url for them.

spec:
declarativeConfig:
file_format: "0.4"
resource:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know why it's like this, but i don't love that we mix camel case and snake case.


The declarative config supports [environment variable substitution](https://opentelemetry.io/docs/specs/otel/configuration/file-configuration/#environment-variable-substitution) using the `${VAR}` syntax. This is useful for injecting secrets like API tokens without hardcoding them in the CR. Environment variables can be set via `spec.env` or per-language `env` fields.

This also addresses a limitation in v1alpha1 where Kubernetes `$(VAR)` substitution fails due to env var ordering ([#3022](https://github.com/open-telemetry/opentelemetry-operator/issues/3022)). Since `${VAR}` substitution in declarative config happens at SDK runtime rather than Kubernetes pod creation time, it works regardless of the order in which env vars are defined.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing that I think would be useful here is to add a "presets" section for setting the resource hierarchy like we do today, this would make it easier for users to opt out and then all we do internally is set the declarative config and let that figure out the layering later on.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The resource attributes in v1beta1 will be handled by:

  • spec.resource.k8sMetadata.enabled — toggle for K8s resource attributes
  • spec.resource.k8sMetadata.includeUIDs — toggle for UID attributes
  • spec.resource.serviceMetadata.enabled — toggle for service identity attributes

They are mutually exclusive. The service name resolution uses the spec https://opentelemetry.io/docs/specs/semconv/non-normative/k8s-attributes/#service-attributes

metadata:
name: env-example
spec:
envConfig:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should note that this will be removed/deprecated when we go to v1

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that is the goal. We might remove it if the SDKs stop supporting the env config

1. Aligns with OpenTelemetry's [declarative configuration](https://github.com/open-telemetry/opentelemetry-configuration) initiative
2. Fixes structural inconsistencies in the current API

## Objectives

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of experience with multiple OTel adopters, treating the trace-context propagation format (and, specifically, opt-in to AWS XRay) as a first-class citizen in the CRD, pays off

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already support in as a first-class citizen in the CRD. The goal is to support as much as possible from the stable config symbols.

Comment thread docs/rfcs/instrumentation-v1beta1.md Outdated

The operator will have a flag to control declarative configuration support (e.g., `--instrumentation-declarative-config=java,python,dotnet,cpp,nodejs`). This allows enabling support as SDKs mature without requiring operator upgrades.

#### Declarative config example

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the system packages SIG, we are having issues with the fact that all implementations of the declarative SDK but Java seem not to allow per-language overrides, e.g. to disable instrumentations. It seems to me you may face the same issue.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

Signed-off-by: Pavol Loffay <p.loffay@gmail.com>
Signed-off-by: Pavol Loffay <p.loffay@gmail.com>
Signed-off-by: Pavol Loffay <p.loffay@gmail.com>
Signed-off-by: Pavol Loffay <p.loffay@gmail.com>
Signed-off-by: Pavol Loffay <p.loffay@gmail.com>
Signed-off-by: Pavol Loffay <p.loffay@gmail.com>
Signed-off-by: Pavol Loffay <p.loffay@gmail.com>
Signed-off-by: Pavol Loffay <p.loffay@gmail.com>
Signed-off-by: Pavol Loffay <p.loffay@gmail.com>
Signed-off-by: Pavol Loffay <p.loffay@gmail.com>
@pavolloffay pavolloffay merged commit b985889 into open-telemetry:main Jun 25, 2026
58 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Skip Changelog PRs that do not require a CHANGELOG.md entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants