@@ -336,12 +336,87 @@ class DistributedTracingSettings(Settings):
336336class DistributedTracingSamplerSettings (Settings ):
337337 pass
338338
339-
340339class DistributedTracingSamplerFullGranularitySettings (Settings ):
340+ _remote_parent_sampled = "default"
341+ _remote_parent_not_sampled = "default"
342+ #@property
343+ #def remote_parent_sampled(self):
344+ # return self._remote_parent_sampled
345+
346+ #@remote_parent_sampled.setter
347+ #def remote_parent_sampled(self, value):
348+ # if isinstance(value, str):
349+ # self._remote_parent_sampled._sampler = value
350+ # else:
351+ # self._remote_parent_sampled = value
352+
353+ #@property
354+ #def remote_parent_not_sampled(self):
355+ # return self._remote_parent_not_sampled
356+
357+ #@remote_parent_not_sampled.setter
358+ #def remote_parent_not_sampled(self, value):
359+ # if isinstance(value, str):
360+ # self._remote_parent_not_sampled._sampler = value
361+ # else:
362+ # self._remote_parent_not_sampled = value
363+
364+
365+ class DistributedTracingSamplerFullGranularityRemoteParentSampledSettings :
366+ pass
367+
368+
369+ class DistributedTracingSamplerFullGranularityRemoteParentSampledAdaptiveSettings :
370+ pass
371+
372+
373+ class DistributedTracingSamplerFullGranularityRemoteParentNotSampledSettings :
374+ pass
375+
376+
377+ class DistributedTracingSamplerFullGranularityRemoteParentNotSampledAdaptiveSettings :
341378 pass
342379
343380
344381class DistributedTracingSamplerPartialGranularitySettings (Settings ):
382+ _remote_parent_sampled = "default"
383+ _remote_parent_not_sampled = "default"
384+ #@property
385+ #def remote_parent_sampled(self):
386+ # return self._remote_parent_sampled
387+
388+ #@remote_parent_sampled.setter
389+ #def remote_parent_sampled(self, value):
390+ # if isinstance(value, str):
391+ # self._remote_parent_sampled._sampler = value
392+ # else:
393+ # self._remote_parent_sampled = value
394+
395+ #@property
396+ #def remote_parent_not_sampled(self):
397+ # return self._remote_parent_not_sampled
398+
399+ #@remote_parent_not_sampled.setter
400+ #def remote_parent_not_sampled(self, value):
401+ # if isinstance(value, str):
402+ # self._remote_parent_not_sampled._sampler = value
403+ # else:
404+ # self._remote_parent_not_sampled = value
405+
406+
407+ class DistributedTracingSamplerPartialGranularityRemoteParentSampledSettings :
408+ pass #_sampler = None
409+
410+
411+ class DistributedTracingSamplerPartialGranularityRemoteParentSampledAdaptiveSettings :
412+ pass
413+
414+
415+ class DistributedTracingSamplerPartialGranularityRemoteParentNotSampledSettings :
416+ pass #_sampler = None
417+
418+
419+ class DistributedTracingSamplerPartialGranularityRemoteParentNotSampledAdaptiveSettings :
345420 pass
346421
347422
@@ -516,7 +591,15 @@ class EventHarvestConfigHarvestLimitSettings(Settings):
516591_settings .distributed_tracing = DistributedTracingSettings ()
517592_settings .distributed_tracing .sampler = DistributedTracingSamplerSettings ()
518593_settings .distributed_tracing .sampler .full_granularity = DistributedTracingSamplerFullGranularitySettings ()
594+ _settings .distributed_tracing .sampler .full_granularity .remote_parent_sampled = DistributedTracingSamplerFullGranularityRemoteParentSampledSettings ()
595+ _settings .distributed_tracing .sampler .full_granularity .remote_parent_sampled .adaptive = DistributedTracingSamplerFullGranularityRemoteParentSampledAdaptiveSettings ()
596+ _settings .distributed_tracing .sampler .full_granularity .remote_parent_not_sampled = DistributedTracingSamplerFullGranularityRemoteParentNotSampledSettings ()
597+ _settings .distributed_tracing .sampler .full_granularity .remote_parent_not_sampled .adaptive = DistributedTracingSamplerFullGranularityRemoteParentNotSampledAdaptiveSettings ()
519598_settings .distributed_tracing .sampler .partial_granularity = DistributedTracingSamplerPartialGranularitySettings ()
599+ _settings .distributed_tracing .sampler .partial_granularity .remote_parent_sampled = DistributedTracingSamplerPartialGranularityRemoteParentSampledSettings ()
600+ _settings .distributed_tracing .sampler .partial_granularity .remote_parent_sampled .adaptive = DistributedTracingSamplerPartialGranularityRemoteParentSampledAdaptiveSettings ()
601+ _settings .distributed_tracing .sampler .partial_granularity .remote_parent_not_sampled = DistributedTracingSamplerPartialGranularityRemoteParentNotSampledSettings ()
602+ _settings .distributed_tracing .sampler .partial_granularity .remote_parent_not_sampled .adaptive = DistributedTracingSamplerPartialGranularityRemoteParentNotSampledAdaptiveSettings ()
520603_settings .error_collector = ErrorCollectorSettings ()
521604_settings .error_collector .attributes = ErrorCollectorAttributesSettings ()
522605_settings .event_harvest_config = EventHarvestConfigSettings ()
@@ -561,6 +644,8 @@ class EventHarvestConfigHarvestLimitSettings(Settings):
561644def _environ_as_int (name , default = 0 ):
562645 val = os .environ .get (name , default )
563646 try :
647+ if default is None and val is None :
648+ return None
564649 return int (val )
565650 except ValueError :
566651 return default
@@ -858,24 +943,36 @@ def default_otlp_host(host):
858943_settings .distributed_tracing .sampler .full_granularity .enabled = _environ_as_bool (
859944 "NEW_RELIC_DISTRIBUTED_TRACING_SAMPLER_FULL_GRANULARITY_ENABLED" , default = True
860945)
861- _settings .distributed_tracing .sampler .full_granularity .remote_parent_sampled = os .environ .get (
946+ _settings .distributed_tracing .sampler .full_granularity ._remote_parent_sampled = ( "adaptive" if os . environ . get ( "NEW_RELIC_DISTRIBUTED_TRACING_SAMPLER_FULL_GRANULARITY_REMOTE_PARENT_SAMPLED_ADAPTIVE_SAMPLING_TARGET" , None ) else None ) or os .environ .get (
862947 "NEW_RELIC_DISTRIBUTED_TRACING_SAMPLER_FULL_GRANULARITY_REMOTE_PARENT_SAMPLED" , None
863948) or os .environ .get ("NEW_RELIC_DISTRIBUTED_TRACING_SAMPLER_REMOTE_PARENT_SAMPLED" , "default" )
864- _settings .distributed_tracing .sampler .full_granularity .remote_parent_not_sampled = os .environ .get (
949+ _settings .distributed_tracing .sampler .full_granularity .remote_parent_sampled .adaptive .sampling_target = _environ_as_int (
950+ "NEW_RELIC_DISTRIBUTED_TRACING_SAMPLER_FULL_GRANULARITY_REMOTE_PARENT_SAMPLED_ADAPTIVE_SAMPLING_TARGET" , None
951+ )
952+ _settings .distributed_tracing .sampler .full_granularity ._remote_parent_not_sampled = ("adaptive" if os .environ .get ("NEW_RELIC_DISTRIBUTED_TRACING_SAMPLER_FULL_GRANULARITY_REMOTE_PARENT_NOT_SAMPLED_ADAPTIVE_SAMPLING_TARGET" , None ) else None ) or os .environ .get (
865953 "NEW_RELIC_DISTRIBUTED_TRACING_SAMPLER_FULL_GRANULARITY_REMOTE_PARENT_NOT_SAMPLED" , None
866954) or os .environ .get ("NEW_RELIC_DISTRIBUTED_TRACING_SAMPLER_REMOTE_PARENT_NOT_SAMPLED" , "default" )
955+ _settings .distributed_tracing .sampler .full_granularity .remote_parent_not_sampled .adaptive .sampling_target = _environ_as_int (
956+ "NEW_RELIC_DISTRIBUTED_TRACING_SAMPLER_FULL_GRANULARITY_REMOTE_PARENT_NOT_SAMPLED_ADAPTIVE_SAMPLING_TARGET" , None
957+ )
867958_settings .distributed_tracing .sampler .partial_granularity .enabled = _environ_as_bool (
868959 "NEW_RELIC_DISTRIBUTED_TRACING_SAMPLER_PARTIAL_GRANULARITY_ENABLED" , default = False
869960)
870961_settings .distributed_tracing .sampler .partial_granularity .type = os .environ .get (
871962 "NEW_RELIC_DISTRIBUTED_TRACING_SAMPLER_PARTIAL_GRANULARITY_TYPE" , "essential"
872963)
873- _settings .distributed_tracing .sampler .partial_granularity .remote_parent_sampled = os .environ .get (
964+ _settings .distributed_tracing .sampler .partial_granularity ._remote_parent_sampled = ( "adaptive" if os . environ . get ( "NEW_RELIC_DISTRIBUTED_TRACING_SAMPLER_PARTIAL_GRANULARITY_REMOTE_PARENT_SAMPLED_ADAPTIVE_SAMPLING_TARGET" , None ) else None ) or os .environ .get (
874965 "NEW_RELIC_DISTRIBUTED_TRACING_SAMPLER_PARTIAL_GRANULARITY_REMOTE_PARENT_SAMPLED" , "default"
875966)
876- _settings .distributed_tracing .sampler .partial_granularity .remote_parent_not_sampled = os .environ .get (
967+ _settings .distributed_tracing .sampler .partial_granularity .remote_parent_sampled .adaptive .sampling_target = _environ_as_int (
968+ "NEW_RELIC_DISTRIBUTED_TRACING_SAMPLER_PARTIAL_GRANULARITY_REMOTE_PARENT_SAMPLED_ADAPTIVE_SAMPLING_TARGET" , None
969+ )
970+ _settings .distributed_tracing .sampler .partial_granularity ._remote_parent_not_sampled = ("adaptive" if os .environ .get ("NEW_RELIC_DISTRIBUTED_TRACING_SAMPLER_PARTIAL_GRANULARITY_REMOTE_PARENT_NOT_SAMPLED_ADAPTIVE_SAMPLING_TARGET" , None ) else None ) or os .environ .get (
877971 "NEW_RELIC_DISTRIBUTED_TRACING_SAMPLER_PARTIAL_GRANULARITY_REMOTE_PARENT_NOT_SAMPLED" , "default"
878972)
973+ _settings .distributed_tracing .sampler .partial_granularity .remote_parent_not_sampled .adaptive .sampling_target = _environ_as_int (
974+ "NEW_RELIC_DISTRIBUTED_TRACING_SAMPLER_PARTIAL_GRANULARITY_REMOTE_PARENT_NOT_SAMPLED_ADAPTIVE_SAMPLING_TARGET" , None
975+ )
879976_settings .distributed_tracing .exclude_newrelic_header = False
880977_settings .span_events .enabled = _environ_as_bool ("NEW_RELIC_SPAN_EVENTS_ENABLED" , default = True )
881978_settings .event_harvest_config .harvest_limits .span_event_data = _environ_as_int (
0 commit comments