-
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
Changes from all commits
7ee5c8b
0bc6f67
2f0fcf9
b945323
c0edabc
3c9bc31
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
self._configure_service_entry_id_span_processor() | ||
|
||
# The txnname calculator span processor must be registered | ||
# before the rest of the processors with defined on_end | ||
self._configure_txnname_calculator_span_processor( | ||
apm_txname_manager, | ||
) | ||
|
@@ -129,9 +133,12 @@ def _configure_otel_components( | |
apm_config, | ||
oboe_api, | ||
) | ||
# The txnname cleanup span processor must be registered | ||
# after the rest of the processors with defined on_end | ||
self._configure_txnname_cleanup_span_processor( | ||
apm_txname_manager, | ||
) | ||
|
||
self._configure_traces_exporter( | ||
reporter, | ||
apm_txname_manager, | ||
|
@@ -247,12 +254,16 @@ def _configure_otlp_metrics_span_processors( | |
apm_config: SolarWindsApmConfig, | ||
oboe_api: "OboeAPI", | ||
) -> None: | ||
"""Configure SolarWindsOTLPMetricsSpanProcessor and ForceFlushSpanProcessor.""" | ||
# TODO Add experimental trace flag, clean up | ||
# https://swicloud.atlassian.net/browse/NH-65067 | ||
if not apm_config.get("experimental").get("otel_collector") is True: | ||
"""Configure SolarWindsOTLPMetricsSpanProcessor (including OTLP meters) | ||
and ForceFlushSpanProcessor, if metrics exporters are configured and set up | ||
i.e. by _configure_metrics_exporter""" | ||
# SolarWindsDistro._configure does setdefault before this is called | ||
environ_exporter = os.environ.get( | ||
OTEL_METRICS_EXPORTER, | ||
) | ||
if not environ_exporter: | ||
logger.debug( | ||
"Experimental otel_collector flag not configured. Not configuring OTLP metrics span processor." | ||
"No OTEL_METRICS_EXPORTER set, skipping init of metrics processors" | ||
) | ||
return | ||
|
||
|
@@ -341,24 +352,16 @@ def _configure_metrics_exporter( | |
self, | ||
apm_config: SolarWindsApmConfig, | ||
) -> None: | ||
"""Configure SolarWinds OTel metrics exporters, environment | ||
configured if any, or none if agent disabled.""" | ||
if not apm_config.agent_enabled: | ||
logger.error("Tracing disabled. Cannot set metrics exporter.") | ||
return | ||
Comment on lines
-346
to
-348
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 ( |
||
|
||
if not apm_config.get("experimental").get("otel_collector") is True: | ||
logger.debug( | ||
"Experimental otel_collector flag not configured. Not setting metrics exporter." | ||
) | ||
return | ||
|
||
"""Configure SolarWinds OTel metrics exporters if any configured. | ||
Links them to new metric readers and global MeterProvider.""" | ||
# SolarWindsDistro._configure does setdefault before this is called | ||
environ_exporter = os.environ.get( | ||
OTEL_METRICS_EXPORTER, | ||
) | ||
if not environ_exporter: | ||
logger.debug("No OTEL_METRICS_EXPORTER set, skipping init") | ||
logger.debug( | ||
"No OTEL_METRICS_EXPORTER set, skipping init of metrics exporters" | ||
) | ||
return | ||
environ_exporter_names = environ_exporter.split(",") | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,6 @@ | |
INTL_SWO_TRANSACTION_ATTR_MAX, | ||
) | ||
from solarwinds_apm.apm_meter_manager import SolarWindsMeterManager | ||
from solarwinds_apm.apm_noop import SolarWindsMeterManager as NoopMeterManager | ||
from solarwinds_apm.trace.base_metrics_processor import _SwBaseMetricsProcessor | ||
|
||
if TYPE_CHECKING: | ||
|
@@ -42,20 +41,10 @@ def __init__( | |
# SW_APM_TRANSACTION_NAME and AWS_LAMBDA_FUNCTION_NAME | ||
self.env_transaction_name = apm_config.get("transaction_name") | ||
self.lambda_function_name = apm_config.lambda_function_name | ||
|
||
# TODO Add experimental trace flag, clean up | ||
# https://swicloud.atlassian.net/browse/NH-65067 | ||
# | ||
if not apm_config.get("experimental").get("otel_collector") is True: | ||
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 commentThe 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 |
||
else: | ||
self.apm_meters = SolarWindsMeterManager( | ||
apm_config, | ||
oboe_api, | ||
) | ||
self.apm_meters = SolarWindsMeterManager( | ||
apm_config, | ||
oboe_api, | ||
) | ||
|
||
def calculate_otlp_transaction_name( | ||
self, | ||
|
This file was deleted.
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.