Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NH-66126 Exporter defaults based on configured protocol #310

Merged
merged 5 commits into from
Feb 12, 2024

Conversation

tammy-baylis-swi
Copy link
Contributor

@tammy-baylis-swi tammy-baylis-swi commented Feb 9, 2024

Before this PR, metrics and traces exporter defaults depended on is_lambda (see #217).

After this PR, the defaults don't depend on lambda. They instead depend on OTEL_EXPORTER_OTLP_PROTOCOL which we require for otlp exporting in any environment.

If Protocol is http/protobuf:

  1. OTEL_METRICS_EXPORTER defaults to otlp_proto_http
  2. OTEL_TRACES_EXPORTER defaults to otlp_proto_http

If Protocol is grpc:

  1. OTEL_METRICS_EXPORTER defaults to otlp_proto_grpc
  2. OTEL_TRACES_EXPORTER defaults to otlp_proto_grpc

If Protocol is anything else or unset:

  1. No default for OTEL_METRICS_EXPORTER. User must configure metrics exporters else none will initialize.
  2. OTEL_TRACES_EXPORTER defaults to solarwinds_exporter

Note that the above are for default values. Any combination of env vars to specify protocol, exporter, endpoint will still be respected.

This does deviate from the Otel default distro, which uses otlp_proto_grpc by default.

We now start packaging otlp_proto_grpc with our layer to better match Otel's layer and because export by grpc is available and working and the default for Otel Python.

@tammy-baylis-swi tammy-baylis-swi force-pushed the NH-66126-map-protocol-to-exporters branch from 6cb86a7 to 6efcff1 Compare February 9, 2024 23:04
@tammy-baylis-swi tammy-baylis-swi marked this pull request as ready for review February 10, 2024 00:37
@tammy-baylis-swi tammy-baylis-swi requested a review from a team as a code owner February 10, 2024 00:37
Comment on lines +341 to +350
logger.debug(
"Setting trace with SimpleSpanProcessor using %s",
exporter_name,
)
span_processor = SimpleSpanProcessor(exporter)
else:
logger.debug(
"Setting trace with BatchSpanProcessor using %s",
exporter_name,
)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unrelated: updates some misleading debug lines

Copy link
Contributor

@cheempz cheempz left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the nice PR description @tammy-baylis-swi!

@tammy-baylis-swi tammy-baylis-swi merged commit cd01197 into main Feb 12, 2024
11 checks passed
@tammy-baylis-swi tammy-baylis-swi deleted the NH-66126-map-protocol-to-exporters branch February 12, 2024 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants