From 893103bd790529c499d7c47d32bd73f20697fda9 Mon Sep 17 00:00:00 2001 From: Mitchell Dumovic Date: Wed, 29 Jul 2020 16:50:06 -0700 Subject: [PATCH 1/2] Change default Sampler to ParentOrElse(AlwaysOn) --- opentelemetry-sdk/src/opentelemetry/sdk/trace/__init__.py | 2 +- opentelemetry-sdk/tests/trace/test_trace.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/opentelemetry-sdk/src/opentelemetry/sdk/trace/__init__.py b/opentelemetry-sdk/src/opentelemetry/sdk/trace/__init__.py index 848f571e6a8..b76ba49ad4a 100644 --- a/opentelemetry-sdk/src/opentelemetry/sdk/trace/__init__.py +++ b/opentelemetry-sdk/src/opentelemetry/sdk/trace/__init__.py @@ -859,7 +859,7 @@ def use_span( class TracerProvider(trace_api.TracerProvider): def __init__( self, - sampler: sampling.Sampler = trace_api.sampling.ALWAYS_ON, + sampler: sampling.Sampler = trace_api.sampling.DEFAULT_ON, resource: Resource = Resource.create_empty(), shutdown_on_exit: bool = True, active_span_processor: Union[ diff --git a/opentelemetry-sdk/tests/trace/test_trace.py b/opentelemetry-sdk/tests/trace/test_trace.py index 02cc836e882..56bb9cfa574 100644 --- a/opentelemetry-sdk/tests/trace/test_trace.py +++ b/opentelemetry-sdk/tests/trace/test_trace.py @@ -344,6 +344,7 @@ def test_start_as_current_span_explicit(self): trace_id=0x000000000000000000000000DEADBEEF, span_id=0x00000000DEADBEF0, is_remote=False, + trace_flags=trace_api.TraceFlags(trace_api.TraceFlags.SAMPLED), ) self.assertEqual(trace_api.get_current_span(), trace_api.INVALID_SPAN) From 685787b171e6b58dd7f23fe56dc6c74a0c8ce06c Mon Sep 17 00:00:00 2001 From: Mitchell Dumovic Date: Wed, 29 Jul 2020 19:08:47 -0700 Subject: [PATCH 2/2] Update changelog --- opentelemetry-sdk/CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/opentelemetry-sdk/CHANGELOG.md b/opentelemetry-sdk/CHANGELOG.md index cbb96eabcd5..6cbde17a87c 100644 --- a/opentelemetry-sdk/CHANGELOG.md +++ b/opentelemetry-sdk/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +- Changed default Sampler to `ParentOrElse(AlwaysOn)` + ## Version 0.11b0 Released 2020-07-28