Adding global config to enable otlp_exporter#2292
Conversation
TAG=agy CONV=60663306-7f95-4fa8-8baa-65483fc3cf16
This updates the goldens to reflect the deprecation and removal of CastToSum and NormalizeSums processors, replaced by the transform processor in master. TAG=agy CONV=60663306-7f95-4fa8-8baa-65483fc3cf16
| for k, v := range enabledExperiments { | ||
| newExperiments[k] = v | ||
| } | ||
| if uc.Global.GetOtlpExporter() { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Decoupled the new config knob with any experiment relation. IT should now only use the config
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
Introduce a shared `internal/ctxkeys` package to store context keys and helpers without introducing circular dependencies between `confgenerator` and `healthchecks`. Update `internal/healthchecks/api_check.go` to rely on `ctxkeys.OtlpExporterFromContext` instead of the deprecated experiments map. TAG=agy CONV=60663306-7f95-4fa8-8baa-65483fc3cf16
Clean up formatting in the test case input file. TAG=agy CONV=60663306-7f95-4fa8-8baa-65483fc3cf16
Clean up formatting across multiple test case input files to ensure consistent style without empty lines immediately following section headers. TAG=agy CONV=60663306-7f95-4fa8-8baa-65483fc3cf16
Remove the newly introduced `internal/ctxkeys` package and move the OtlpExporter context keys and helper functions directly into the existing `internal/experiments` package. This avoids package bloat since `internal/experiments` is already a shared dependency imported by both `confgenerator` and `healthchecks` to manage feature states. TAG=agy CONV=60663306-7f95-4fa8-8baa-65483fc3cf16
Remove the `ctx` parameter from `HealthCheckRegistryFactory` and all individual diagnostic check functions (`runLoggingCheck`, etc.), reverting them to use `context.Background()` internally as they did in master. Since `otlpExporterEnabled` is now passed explicitly as a boolean parameter, we no longer need the context to carry the configuration state through the health check layer. TAG=agy CONV=60663306-7f95-4fa8-8baa-65483fc3cf16
Remove redundant ContextWithExperiments calls from confmerger.go, files.go, and self_metrics.go, as these are already handled internally by downstream functions (Validate, GenerateConfigs, ExtractFeatures). Revert ParseExperimentalFeatures in experiments.go to match master styling. These 4 files are now 100% identical to master. TAG=agy CONV=60663306-7f95-4fa8-8baa-65483fc3cf16
This updates the goldens to reflect recent master changes that added metric_start_time processor for IIS receiver. TAG=agy CONV=60663306-7f95-4fa8-8baa-65483fc3cf16
Update `getHealthCheckResults` call in `main_windows.go` to match the new signature (pass `otlpExporterEnabled bool` instead of `ctx`). Update `runHealthChecks` call in `service_windows_test.go` to match the new signature (remove `ctx` and pass `false` for `otlpExporterEnabled`). TAG=agy CONV=60663306-7f95-4fa8-8baa-65483fc3cf16
Remove the unused `ctx = uc.ContextWithExperiments(ctx)` call from UAP plugin's `Start` method on Windows, as the `ctx` variable is not referenced anywhere after this line following the health check context refactoring. TAG=agy CONV=60663306-7f95-4fa8-8baa-65483fc3cf16
| newExperiments[k] = v | ||
| } | ||
| ctx = experiments.ContextWithExperiments(ctx, newExperiments) | ||
| if uc.Global.GetOtlpExporter() || OtlpExporterFromContext(ctx) { |
There was a problem hiding this comment.
I think if should only check for uc.Global.GetOtlpExporter() here.
|
Can we implement this without propagating the 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." |
…version Completely eliminate OTLP exporter configuration propagation through context. Instead, implement a post-processing conversion pass (`ConvertPipelinesToOtlp`) in `GenerateOtelConfig` that runs after all pipelines (including self-metrics) have been generated, but before the final OTel YAML is produced. Details: - Remove `ContextWithOtlpExporter`, `OtlpExporterFromContext`, and `otlpExporterKey` from config.go. - Make old converter wrappers in confgenerator.go (ConvertGCMOtelExporterToOtlpExporter, etc.) dummy no-ops to avoid changing 24+ third-party app files. - Decouple `AgentSelfMetrics` by adding `OtlpExporterEnabled` field directly to the struct. - Decouple feature tracking by passing `UnifiedConfig` to `getOtlpExporterFeatureConfig`. - Update tests to use programmatic configuration updates or post-processing conversion instead of context overrides. TAG=agy CONV=60663306-7f95-4fa8-8baa-65483fc3cf16
…nd clean up redundant context wrapping Conclude the merge from master. Resolve the conflict in `confgenerator/config.go` by removing the `ContextWithExperiments` definition and deprecated port constants. Also, completely clean up the redundant `ContextWithExperiments` calls from `main.go`, `run_windows.go`, `confgenerator.go`, `config.go` (Validate), and `feature_tracking.go`. Since the OTLP exporter has been decoupled from experiments, we no longer need this programmatic experiments wrapping context mechanism at all! TAG=agy CONV=60663306-7f95-4fa8-8baa-65483fc3cf16
Group imports into standard, third-party, and project-local blocks to satisfy the gci linter rules. TAG=agy CONV=60663306-7f95-4fa8-8baa-65483fc3cf16
Remove the duplicate empty line at line 74 and re-format/re-group the imports block using golangci-lint run --fix to satisfy the strict gci linter rules. TAG=agy CONV=60663306-7f95-4fa8-8baa-65483fc3cf16
| if _, ok := pipeline.ExporterTypes["logs"]; ok { | ||
| pipeline.ExporterTypes["logs"] = otel.OTLP_Logs | ||
| if _, ok := pipeline.ExporterTypes["logs"]; ok { | ||
| if pipeline.ExporterTypes["logs"] == otel.Logging { |
There was a problem hiding this comment.
i dont think this if clause is necessary here. All Otel logging pipielines use otel.Logging as the exporter.
|
Please make sure all integration tests pass, except for flakes. |
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: