Fix - Simplify otel configuration and deprecate SW_APM_EXPORT_LOGS_ENABLED#421
Open
cleverchuk wants to merge 1 commit intomainfrom
Open
Fix - Simplify otel configuration and deprecate SW_APM_EXPORT_LOGS_ENABLED#421cleverchuk wants to merge 1 commit intomainfrom
SW_APM_EXPORT_LOGS_ENABLED#421cleverchuk wants to merge 1 commit intomainfrom
Conversation
| } | ||
|
|
||
| static void configureOtelMetricExport(ConfigContainer container) throws InvalidConfigException { | ||
| static void configureOtel(ConfigContainer container) throws InvalidConfigException { |
There was a problem hiding this comment.
Just making sure:SW_APM_EXPORT_LOGS_ENABLED is deprecated from this, not fully dropped?
There was a problem hiding this comment.
...i.e. we do want to drop its support, but I'm not clear on if this introduces deprecation-with-a-warning first
Contributor
Author
There was a problem hiding this comment.
yes. it's noop now.
tammy-baylis-swi
approved these changes
Feb 19, 2026
tammy-baylis-swi
left a comment
There was a problem hiding this comment.
Awesome! So much tidier and agree it's good to use what OTel SDK is already doing. Just had a question.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces per-signal OTLP configuration (separate endpoints, headers, and protocol for traces, metrics, and logs) with a single global OTLP configuration. This eliminates ~390 lines of duplicated logic across three nearly-identical methods and deprecates the
SW_APM_EXPORT_LOGS_ENABLEDenvironment variable.Motivation
The previous implementation configured each OTLP signal (traces, metrics, logs) independently via dedicated methods (
configureOtelTraceExport,configureOtelMetricExport,configureOtelLogExport). Each method:http/protobuf)/v1/traces,/v1/metrics,/v1/logs)otel.exporter.otlp.traces.*,otel.exporter.otlp.metrics.*,otel.exporter.otlp.logs.*)This was unnecessary because the OTel SDK natively supports global OTLP configuration (
otel.exporter.otlp.endpoint,otel.exporter.otlp.headers) and automatically appends the correct signal path when per-signal overrides are absent. The agent was reimplementing logic the SDK already provides.Changes
Unified
configureOtelmethodThe three per-signal methods are replaced by a single
configureOtelmethod that sets only two global properties:otel.exporter.otlp.headers— Bearer token derived from the service keyotel.exporter.otlp.endpoint— Base collector URL (without signal path suffixes)Both properties are set only if not already configured by the user (via system property or environment variable), preventing the agent from clobbering explicit user configuration.
Removed hardcoded protocol default
The agent no longer forces
otel.exporter.otlp.protocol=http/protobuf. The OTel SDK's own default protocol is used instead. The lambda properties supplier also drops itsotel.exporter.otlp.protocol=grpcoverride.Metrics exporter no longer disabled by default
otel.metrics.exporter=noneis removed fromSolarwindsPropertiesSupplier. Metrics export is now enabled by default, aligning with the SDK's standard behavior.Deprecated
SW_APM_EXPORT_LOGS_ENABLEDLog export was previously gated behind
SW_APM_EXPORT_LOGS_ENABLED. With global OTLP config, log export behavior is now controlled by the standardotel.logs.exporterproperty (still defaulted tononein the properties supplier). The custom flag is no longer evaluated.Simplified internal helpers
Removed
setSystemProperty,setEndpoint,setProtocol, andgetConfigValue. Replaced with a singleisConfigNotSet(key)predicate that checks both system properties and environment variables.Testing
Tests are rewritten to validate the new global configuration behavior:
na-01.cloudwhen no collector is configuredTest services data