-
Notifications
You must be signed in to change notification settings - Fork 1
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-65067 Remove support for experimental flag #308
Conversation
d181175
to
7ee5c8b
Compare
from .fixtures.sampler import ( | ||
fixture_swsampler, | ||
fixture_swsampler_is_lambda, | ||
) |
Check notice
Code scanning / CodeQL
Unused import Note test
Import of 'fixture_swsampler_is_lambda' is not used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry bot I am not refactoring the fixtures in this PR
f9f08bb
to
b945323
Compare
@@ -116,7 +116,11 @@ def _configure_otel_components( | |||
if apm_config.agent_enabled: | |||
# set MeterProvider first via metrics_exporter config | |||
self._configure_metrics_exporter(apm_config) | |||
# This processor only defines on_start |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this and other comments because I keep forgetting the reasons for the processors registration order.
if not apm_config.agent_enabled: | ||
logger.error("Tracing disabled. Cannot set metrics exporter.") | ||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've removed this check because the caller is already doing the enabled check (_configure_otel_components
further up)
logger.debug( | ||
"Experimental otel_collector flag not configured. Creating meter manager as no-op." | ||
) | ||
self.apm_meters = NoopMeterManager() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is no longer necessary because this processor will not be initialized at all if no OTEL_METRICS_EXPORTER
. Keeping the no-op class for now in case new config features/refactor later on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cleanup looks good to me
Removes support of the
experimental
flag required to init components for OTLP generation and export.The presence of
OTEL_METRICS_EXPORTER
becomes the condition for whether or not metrics meters, exporters, readers, MeterProvider, and related span processors are initialized. I don't love where the checks are but this is easy and hopefully clear enough for now.The default values for
OTEL_METRICS_EXPORTER
are the same and depend on is_lambda; see #217. The check for is_lambda also stays the same.Please let me know what you think!