@@ -379,39 +379,41 @@ class DistributedTracingSamplerFullGranularityRemoteParentNotSampledAdaptiveSett
379379
380380
381381class DistributedTracingSamplerPartialGranularitySettings (Settings ):
382- @property
383- def remote_parent_sampled (self ):
384- return self ._remote_parent_sampled
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
385387
386- @remote_parent_sampled .setter
387- def remote_parent_sampled (self , value ):
388- if isinstance (value , str ):
389- self ._remote_parent_sampled ._sampler = value
390- else :
391- self ._remote_parent_sampled = value
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
392394
393- @property
394- def remote_parent_not_sampled (self ):
395- return self ._remote_parent_not_sampled
395+ # @property
396+ # def remote_parent_not_sampled(self):
397+ # return self._remote_parent_not_sampled
396398
397- @remote_parent_not_sampled .setter
398- def remote_parent_not_sampled (self , value ):
399- if isinstance (value , str ):
400- self ._remote_parent_not_sampled ._sampler = value
401- else :
402- self ._remote_parent_not_sampled = value
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
403405
404406
405407class DistributedTracingSamplerPartialGranularityRemoteParentSampledSettings :
406- _sampler = None
408+ pass # _sampler = None
407409
408410
409411class DistributedTracingSamplerPartialGranularityRemoteParentSampledAdaptiveSettings :
410412 pass
411413
412414
413415class DistributedTracingSamplerPartialGranularityRemoteParentNotSampledSettings :
414- _sampler = None
416+ pass # _sampler = None
415417
416418
417419class DistributedTracingSamplerPartialGranularityRemoteParentNotSampledAdaptiveSettings :
@@ -642,6 +644,8 @@ class EventHarvestConfigHarvestLimitSettings(Settings):
642644def _environ_as_int (name , default = 0 ):
643645 val = os .environ .get (name , default )
644646 try :
647+ if default is None and val is None :
648+ return None
645649 return int (val )
646650 except ValueError :
647651 return default
@@ -939,34 +943,34 @@ def default_otlp_host(host):
939943_settings .distributed_tracing .sampler .full_granularity .enabled = _environ_as_bool (
940944 "NEW_RELIC_DISTRIBUTED_TRACING_SAMPLER_FULL_GRANULARITY_ENABLED" , default = True
941945)
942- _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 (
943947 "NEW_RELIC_DISTRIBUTED_TRACING_SAMPLER_FULL_GRANULARITY_REMOTE_PARENT_SAMPLED" , None
944948) or os .environ .get ("NEW_RELIC_DISTRIBUTED_TRACING_SAMPLER_REMOTE_PARENT_SAMPLED" , "default" )
945- _settings .distributed_tracing .sampler .full_granularity .remote_parent_sampled .adaptive .sampling_target = os . environ . get (
949+ _settings .distributed_tracing .sampler .full_granularity .remote_parent_sampled .adaptive .sampling_target = _environ_as_int (
946950 "NEW_RELIC_DISTRIBUTED_TRACING_SAMPLER_FULL_GRANULARITY_REMOTE_PARENT_SAMPLED_ADAPTIVE_SAMPLING_TARGET" , None
947- ) or os .environ .get ("NEW_RELIC_DISTRIBUTED_TRACING_SAMPLER_REMOTE_PARENT_SAMPLED_ADAPTIVE_SAMPLING_TARGET" , "default" )
948- _settings .distributed_tracing .sampler .full_granularity ._remote_parent_not_sampled = os .environ .get (
949- "NEW_RELIC_DISTRIBUTED_TRACING_SAMPLER_FULL_GRANULARITY_REMOTE_PARENT_NOT_SAMPLED_ADAPTIVE_SAMPLING_TARGET" , None
950- ) or os .environ .get ("NEW_RELIC_DISTRIBUTED_TRACING_SAMPLER_REMOTE_PARENT_NOT_SAMPLED_ADAPTIVE_SAMPLING_TARGET" , "default" )
951- _settings .distributed_tracing .sampler .full_granularity .remote_parent_not_sampled .adaptive .sampling_target = os .environ .get (
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 (
952953 "NEW_RELIC_DISTRIBUTED_TRACING_SAMPLER_FULL_GRANULARITY_REMOTE_PARENT_NOT_SAMPLED" , None
953954) 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+ )
954958_settings .distributed_tracing .sampler .partial_granularity .enabled = _environ_as_bool (
955959 "NEW_RELIC_DISTRIBUTED_TRACING_SAMPLER_PARTIAL_GRANULARITY_ENABLED" , default = False
956960)
957961_settings .distributed_tracing .sampler .partial_granularity .type = os .environ .get (
958962 "NEW_RELIC_DISTRIBUTED_TRACING_SAMPLER_PARTIAL_GRANULARITY_TYPE" , "essential"
959963)
960- _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 (
961965 "NEW_RELIC_DISTRIBUTED_TRACING_SAMPLER_PARTIAL_GRANULARITY_REMOTE_PARENT_SAMPLED" , "default"
962966)
963- _settings .distributed_tracing .sampler .partial_granularity .remote_parent_sampled .adaptive .sampling_target = os . environ . get (
967+ _settings .distributed_tracing .sampler .partial_granularity .remote_parent_sampled .adaptive .sampling_target = _environ_as_int (
964968 "NEW_RELIC_DISTRIBUTED_TRACING_SAMPLER_PARTIAL_GRANULARITY_REMOTE_PARENT_SAMPLED_ADAPTIVE_SAMPLING_TARGET" , None
965969)
966- _settings .distributed_tracing .sampler .partial_granularity ._remote_parent_not_sampled = os .environ .get (
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 (
967971 "NEW_RELIC_DISTRIBUTED_TRACING_SAMPLER_PARTIAL_GRANULARITY_REMOTE_PARENT_NOT_SAMPLED" , "default"
968972)
969- _settings .distributed_tracing .sampler .partial_granularity .remote_parent_not_sampled .adaptive .sampling_target = os . environ . get (
973+ _settings .distributed_tracing .sampler .partial_granularity .remote_parent_not_sampled .adaptive .sampling_target = _environ_as_int (
970974 "NEW_RELIC_DISTRIBUTED_TRACING_SAMPLER_PARTIAL_GRANULARITY_REMOTE_PARENT_NOT_SAMPLED_ADAPTIVE_SAMPLING_TARGET" , None
971975)
972976_settings .distributed_tracing .exclude_newrelic_header = False
0 commit comments