Skip to content

Adding global config to enable otlp_exporter - #2292

Merged
rafaelwestphal merged 1 commit into
masterfrom
westphalrafael/otlp_exporter_config_knob
Sep 2, 2026
Merged

Adding global config to enable otlp_exporter#2292
rafaelwestphal merged 1 commit into
masterfrom
westphalrafael/otlp_exporter_config_knob

Conversation

@rafaelwestphal

@rafaelwestphal rafaelwestphal commented May 6, 2026

Copy link
Copy Markdown
Contributor

Description

This PR removed the environment variables mechanism to enable the OTLP exporters, and change it to a global config in the config.yaml

otlp_exporter: true

Related issue

b/513235176

How has this been tested?

Teseted in a VM with the new feature

Checklist:

  • Unit tests
    • Unit tests do not apply.
    • Unit tests have been added/modified and passed for this PR.
  • Integration tests
    • Integration tests do not apply.
    • Integration tests have been added/modified and passed for this PR.
  • Documentation
    • This PR introduces no user visible changes.
    • This PR introduces user visible changes and the corresponding documentation change has been made.
  • Minor version bump
    • This PR introduces no new features.
    • This PR introduces new features, and there is a separate PR to bump the minor version since the last release already.
    • This PR bumps the version.

@rafaelwestphal
rafaelwestphal marked this pull request as ready for review May 13, 2026 20:59
@rafaelwestphal rafaelwestphal changed the title Initial Implementation of global knob for otlp_exporter Adding global config to enable otlp_exporter May 15, 2026
Comment thread confgenerator/config.go Outdated
for k, v := range enabledExperiments {
newExperiments[k] = v
}
if uc.Global.GetOtlpExporter() {

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.

the global config knob should replace the experimental flag.

We should remove any references to the otlp_exporter experimental flag in the confgenerator. Instead, we should rely on verifying whether the global configuration OtlpExporter is set.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Decoupled the new config knob with any experiment relation. IT should now only use the config

rafaelwestphal added a commit that referenced this pull request May 21, 2026
Remove all references to the `otlp_exporter` experimental flag in the confgenerator.
Instead, rely on verifying whether the global configuration `OtlpExporter` is set using a dedicated context helper.
Also, update tests to use the new ContextWithOtlpExporter helper.

TAG=agy
CONV=60663306-7f95-4fa8-8baa-65483fc3cf16
Comment thread confgenerator/config.go Outdated
newExperiments[k] = v
}
ctx = experiments.ContextWithExperiments(ctx, newExperiments)
if uc.Global.GetOtlpExporter() || OtlpExporterFromContext(ctx) {

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 think if should only check for uc.Global.GetOtlpExporter() here.

@XuechunHou

Copy link
Copy Markdown
Contributor

Can we implement this without propagating the otlpExporter config setting through context?

Here is a my prototype: https://screenshot.googleplex.com/AamNBzffYZrN3Ln, i.e: After we generate all the OTel pipelines, but before the actual OTel YAML config is generated (link), we replace the Google Cloud exporter with the OTLP exporter."

if _, ok := pipeline.ExporterTypes["logs"]; ok {
pipeline.ExporterTypes["logs"] = otel.OTLP_Logs
if _, ok := pipeline.ExporterTypes["logs"]; ok {
if pipeline.ExporterTypes["logs"] == otel.Logging {

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 dont think this if clause is necessary here. All Otel logging pipielines use otel.Logging as the exporter.

@XuechunHou

Copy link
Copy Markdown
Contributor

Please make sure all integration tests pass, except for flakes.

@rafaelwestphal
rafaelwestphal force-pushed the westphalrafael/otlp_exporter_config_knob branch from a4825a5 to 0cd6255 Compare June 10, 2026 17:58
@XuechunHou
XuechunHou self-requested a review September 1, 2026 19:27
…aces (#2292)

* Implement global.otlp_exporter configuration knob in ops-agent
* Route prometheus and traces to OTLP exporter when enabled
* Ensure prometheus metrics exported via OTLP have prometheus.googleapis.com prefix
* Add healthcheck support for OTLP traces and metrics
* Update golden files and integration tests
@rafaelwestphal
rafaelwestphal force-pushed the westphalrafael/otlp_exporter_config_knob branch from a10909b to bba71e5 Compare September 2, 2026 17:57
@rafaelwestphal
rafaelwestphal merged commit 999cf08 into master Sep 2, 2026
83 of 86 checks passed
@rafaelwestphal
rafaelwestphal deleted the westphalrafael/otlp_exporter_config_knob branch September 2, 2026 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants