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-65067 Remove support for experimental flag #308

Merged
merged 6 commits into from
Feb 9, 2024

Conversation

tammy-baylis-swi
Copy link
Contributor

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

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!

@tammy-baylis-swi tammy-baylis-swi force-pushed the NH-65067-rm-exptl-flag-support branch from d181175 to 7ee5c8b Compare February 8, 2024 01:00
Comment on lines +22 to +25
from .fixtures.sampler import (
fixture_swsampler,
fixture_swsampler_is_lambda,
)

Check notice

Code scanning / CodeQL

Unused import Note test

Import of 'fixture_swsampler' is not used.
Import of 'fixture_swsampler_is_lambda' is not used.
Copy link
Contributor Author

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

@tammy-baylis-swi tammy-baylis-swi force-pushed the NH-65067-rm-exptl-flag-support branch from f9f08bb to b945323 Compare February 8, 2024 01:46
@@ -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
Copy link
Contributor Author

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.

Comment on lines -346 to -348
if not apm_config.agent_enabled:
logger.error("Tracing disabled. Cannot set metrics exporter.")
return
Copy link
Contributor Author

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()
Copy link
Contributor Author

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.

@tammy-baylis-swi tammy-baylis-swi marked this pull request as ready for review February 8, 2024 02:12
@tammy-baylis-swi tammy-baylis-swi requested a review from a team as a code owner February 8, 2024 02:12
Copy link

@xuan-cao-swi xuan-cao-swi left a 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

@tammy-baylis-swi tammy-baylis-swi merged commit 9a19035 into main Feb 9, 2024
11 checks passed
@tammy-baylis-swi tammy-baylis-swi deleted the NH-65067-rm-exptl-flag-support branch February 9, 2024 18:19
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