Conversation
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. This PR will not appear in the changelog. 🤖 This preview updates automatically when you update the PR. |
Codecov Results 📊✅ 12 passed | Total: 12 | Pass Rate: 100% | Execution Time: 1.47s All tests are passing successfully. ❌ Patch coverage is 7.04%. Project has 14656 uncovered lines. Files with missing lines (4)
Generated by Codecov Action |
| kwargs_headers = {} | ||
|
|
||
| task_name = kwargs_headers.get("task") | ||
| task_name = kwargs_headers.get("task") or "<unknown Celery task>" |
There was a problem hiding this comment.
This is used for naming the span and spans v2 must always have a name, name=None is not supported.
| "trace_id": item.trace_id, | ||
| "span_id": item.span_id, | ||
| "name": item._name, | ||
| "name": item._name if item._name is not None else "<unknown>", |
There was a problem hiding this comment.
Guarding against sending null span names also here, directly in the batcher, since it'd be a protocol violation
With the fix for task_name above, there are no known cases where this would happen, but better to be safe
| self._active: bool = active | ||
| self._attributes: "Attributes" = {} | ||
| self._attributes: "Attributes" = { | ||
| "sentry.origin": "manual", |
There was a problem hiding this comment.
This was an oversight in the core logic -- we were never setting sentry.origin for custom instrumentation
| self._transaction_info["source"] = str( | ||
| span._attributes["sentry.span.source"] |
There was a problem hiding this comment.
If you're wondering what the str() is doing here, the answer is mypy 😎 😭
Description
Support streaming mode in the Celery integration.
This is the first integration that contains explicit guards against creating certain spans as segments, mirroring how
start_spanworks currently -- it won't create a span if there's no transaction. In Celery, there were multiple spots that, if we just replaced all legacystart_spans with the newtraces.start_span, would've created new segment spans, leading to a change in behavior.Best viewed with
Hide whitespace😎Issues