Skip to content

Commit de1b0e3

Browse files
committed
Merge remote-tracking branch 'origin/master' into potel-base
2 parents f0c1a84 + ee84c81 commit de1b0e3

23 files changed

+279
-127
lines changed

.tool-versions

Lines changed: 0 additions & 1 deletion
This file was deleted.

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,26 @@
11
# Changelog
22

3+
## 2.8.0
4+
5+
### Various fixes & improvements
6+
7+
- `profiler_id` uses underscore (#3249) by @Zylphrex
8+
- Don't send full env to subprocess (#3251) by @kmichel-aiven
9+
- Stop using `Hub` in `HttpTransport` (#3247) by @szokeasaurusrex
10+
- Remove `ipdb` from test requirements (#3237) by @rominf
11+
- Avoid propagation of empty baggage (#2968) by @hartungstenio
12+
- Add entry point for `SentryPropagator` (#3086) by @mender
13+
- Bump checkouts/data-schemas from `8c13457` to `88273a9` (#3225) by @dependabot
14+
15+
## 2.7.1
16+
17+
### Various fixes & improvements
18+
19+
- fix(otel): Fix missing baggage (#3218) by @sentrivana
20+
- This is the config file of asdf-vm which we do not use. (#3215) by @antonpirker
21+
- Added option to disable middleware spans in Starlette (#3052) by @antonpirker
22+
- build: Update tornado version in setup.py to match code check. (#3206) by @aclemons
23+
324
## 2.7.0
425

526
- Add `origin` to spans and transactions (#3133) by @antonpirker

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
copyright = "2019-{}, Sentry Team and Contributors".format(datetime.now().year)
2929
author = "Sentry Team and Contributors"
3030

31-
release = "2.7.0"
31+
release = "2.8.0"
3232
version = ".".join(release.split(".")[:2]) # The short X.Y version.
3333

3434

requirements-testing.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,4 @@ executing
1010
asttokens
1111
responses
1212
pysocks
13-
ipdb
1413
setuptools

sentry_sdk/consts.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ class SPANDATA:
379379
Example: "MainThread"
380380
"""
381381

382-
PROFILER_ID = "profiler.id"
382+
PROFILER_ID = "profiler_id"
383383
"""
384384
Label identifying the profiler id that the span occurred in. This should be a string.
385385
Example: "5249fbada8d5416482c2f6e47e337372"
@@ -529,4 +529,4 @@ def _get_default_options():
529529
del _get_default_options
530530

531531

532-
VERSION = "2.7.0"
532+
VERSION = "2.8.0"

sentry_sdk/integrations/opentelemetry/propagator.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,23 @@
1717
SpanContext,
1818
TraceFlags,
1919
)
20+
21+
from sentry_sdk._types import TYPE_CHECKING
2022
from sentry_sdk.integrations.opentelemetry.consts import (
2123
SENTRY_BAGGAGE_KEY,
2224
SENTRY_TRACE_KEY,
2325
)
2426
from sentry_sdk.integrations.opentelemetry.span_processor import (
2527
SentrySpanProcessor,
2628
)
27-
2829
from sentry_sdk.tracing import (
2930
BAGGAGE_HEADER_NAME,
3031
SENTRY_TRACE_HEADER_NAME,
3132
)
3233
from sentry_sdk.tracing_utils import Baggage, extract_sentrytrace_data
33-
from sentry_sdk._types import TYPE_CHECKING
3434

3535
if TYPE_CHECKING:
36-
from typing import Optional
37-
from typing import Set
36+
from typing import Optional, Set
3837

3938

4039
class SentryPropagator(TextMapPropagator):
@@ -107,7 +106,9 @@ def inject(self, carrier, context=None, setter=default_setter):
107106
if sentry_span.containing_transaction:
108107
baggage = sentry_span.containing_transaction.get_baggage()
109108
if baggage:
110-
setter.set(carrier, BAGGAGE_HEADER_NAME, baggage.serialize())
109+
baggage_data = baggage.serialize()
110+
if baggage_data:
111+
setter.set(carrier, BAGGAGE_HEADER_NAME, baggage_data)
111112

112113
@property
113114
def fields(self):

sentry_sdk/integrations/opentelemetry/span_processor.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -253,17 +253,14 @@ def _get_trace_data(self, otel_span, parent_context):
253253
)
254254
trace_data["parent_span_id"] = parent_span_id
255255

256-
if parent_context is not None:
257-
sentry_trace_data = get_value(SENTRY_TRACE_KEY, parent_context)
258-
sentry_trace_data = cast(
259-
"dict[str, Union[str, bool, None]]", sentry_trace_data
260-
)
261-
trace_data["parent_sampled"] = (
262-
sentry_trace_data["parent_sampled"] if sentry_trace_data else None
263-
)
256+
sentry_trace_data = get_value(SENTRY_TRACE_KEY, parent_context)
257+
sentry_trace_data = cast("dict[str, Union[str, bool, None]]", sentry_trace_data)
258+
trace_data["parent_sampled"] = (
259+
sentry_trace_data["parent_sampled"] if sentry_trace_data else None
260+
)
264261

265-
baggage = get_value(SENTRY_BAGGAGE_KEY, parent_context)
266-
trace_data["baggage"] = baggage
262+
baggage = get_value(SENTRY_BAGGAGE_KEY, parent_context)
263+
trace_data["baggage"] = baggage
267264

268265
return trace_data
269266

sentry_sdk/integrations/stdlib.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,11 @@ def sentry_patched_popen_init(self, *a, **kw):
207207
):
208208
if env is None:
209209
env = _init_argument(
210-
a, kw, "env", 10, lambda x: dict(x or os.environ)
210+
a,
211+
kw,
212+
"env",
213+
10,
214+
lambda x: dict(x if x is not None else os.environ),
211215
)
212216
env["SUBPROCESS_" + k.upper().replace("-", "_")] = v
213217

sentry_sdk/tracing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ class TransactionKwargs(SpanKwargs, total=False):
115115
ProfileContext = TypedDict(
116116
"ProfileContext",
117117
{
118-
"profiler.id": str,
118+
"profiler_id": str,
119119
},
120120
)
121121

@@ -693,7 +693,7 @@ def get_profile_context(self):
693693
return None
694694

695695
return {
696-
"profiler.id": profiler_id,
696+
"profiler_id": profiler_id,
697697
}
698698

699699

0 commit comments

Comments
 (0)