Skip to content

Commit d331927

Browse files
committed
Add config settings
1 parent 5661e81 commit d331927

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

newrelic/config.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,8 @@ def _process_configuration(section):
400400
_process_setting(section, "ml_insights_events.enabled", "getboolean", None)
401401
_process_setting(section, "distributed_tracing.enabled", "getboolean", None)
402402
_process_setting(section, "distributed_tracing.exclude_newrelic_header", "getboolean", None)
403+
_process_setting(section, "distributed_tracing.sampler.remote_parent_sampled", "get", None)
404+
_process_setting(section, "distributed_tracing.sampler.remote_parent_not_sampled", "get", None)
403405
_process_setting(section, "span_events.enabled", "getboolean", None)
404406
_process_setting(section, "span_events.max_samples_stored", "getint", None)
405407
_process_setting(section, "span_events.attributes.enabled", "getboolean", None)

newrelic/core/config.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,8 @@ class SpanEventAttributesSettings(Settings):
323323
class DistributedTracingSettings(Settings):
324324
pass
325325

326+
class DistributedTracingSamplerSettings(Settings):
327+
pass
326328

327329
class ServerlessModeSettings(Settings):
328330
pass
@@ -493,6 +495,7 @@ class EventHarvestConfigHarvestLimitSettings(Settings):
493495
_settings.datastore_tracer.instance_reporting = DatastoreTracerInstanceReportingSettings()
494496
_settings.debug = DebugSettings()
495497
_settings.distributed_tracing = DistributedTracingSettings()
498+
_settings.distributed_tracing.sampler = DistributedTracingSamplerSettings()
496499
_settings.error_collector = ErrorCollectorSettings()
497500
_settings.error_collector.attributes = ErrorCollectorAttributesSettings()
498501
_settings.event_harvest_config = EventHarvestConfigSettings()
@@ -814,6 +817,8 @@ def default_otlp_host(host):
814817
_settings.ml_insights_events.enabled = False
815818

816819
_settings.distributed_tracing.enabled = _environ_as_bool("NEW_RELIC_DISTRIBUTED_TRACING_ENABLED", default=True)
820+
_settings.distributed_tracing.sampler.remote_parent_sampled = os.environ.get("NEW_RELIC_DISTRIBUTED_TRACING_SAMPLER_REMOTE_PARENT_SAMPLED", 'default')
821+
_settings.distributed_tracing.sampler.remote_parent_not_sampled = os.environ.get("NEW_RELIC_DISTRIBUTED_TRACING_SAMPLER_REMOTE_PARENT_NOT_SAMPLED", 'default')
817822
_settings.distributed_tracing.exclude_newrelic_header = False
818823
_settings.span_events.enabled = _environ_as_bool("NEW_RELIC_SPAN_EVENTS_ENABLED", default=True)
819824
_settings.span_events.attributes.enabled = True

0 commit comments

Comments
 (0)