Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 0596485

Browse files
authoredFeb 3, 2023
Merge branch 'main' into exclude
2 parents 8354fe2 + 673e4aa commit 0596485

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed
 

‎CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Added
1111

12+
- `opentelemetry-instrumentation-celery` Record exceptions as events on the span.
13+
([#1573](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1573))
1214
- Add metric instrumentation for urllib
1315
([#1553](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1553))
1416
- `opentelemetry/sdk/extension/aws` Implement [`aws.ecs.*`](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/cloud_provider/aws/ecs.md) and [`aws.logs.*`](https://opentelemetry.io/docs/reference/specification/resource/semantic_conventions/cloud_provider/aws/logs/) resource attributes in the `AwsEcsResourceDetector` detector when the ECS Metadata v4 is available

‎README.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,15 @@ Meeting notes are available as a public [Google doc](https://docs.google.com/doc
9595
Approvers ([@open-telemetry/python-approvers](https://github.com/orgs/open-telemetry/teams/python-approvers)):
9696

9797
- [Aaron Abbott](https://github.com/aabmass), Google
98-
- [Nathaniel Ruiz Nowell](https://github.com/NathanielRN), AWS
99-
- [Owais Lone](https://github.com/owais), Splunk
10098
- [Sanket Mehta](https://github.com/sanketmehta28), Cisco
101-
- [Ashutosh Goel](https://github.com/ashu658), Cisco
99+
- [Shalev Roda](https://github.com/shalevr), Cisco
102100

103101
Emeritus Approvers:
104102

105103
- [Hector Hernandez](https://github.com/hectorhdzg), Microsoft
106104
- [Yusuke Tsutsumi](https://github.com/toumorokoshi), Google
105+
- [Nathaniel Ruiz Nowell](https://github.com/NathanielRN), AWS
106+
- [Ashutosh Goel](https://github.com/ashu658), Cisco
107107

108108
*Find more about the approver role in [community repository](https://github.com/open-telemetry/community/blob/main/community-membership.md#approver).*
109109

@@ -116,6 +116,7 @@ Maintainers ([@open-telemetry/python-maintainers](https://github.com/orgs/open-t
116116
Emeritus Maintainers:
117117

118118
- [Alex Boten](https://github.com/codeboten), Lightstep
119+
- [Owais Lone](https://github.com/owais), Splunk
119120

120121
*Find more about the maintainer role in [community repository](https://github.com/open-telemetry/community/blob/main/community-membership.md#maintainer).*
121122

‎instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ def _trace_failure(*args, **kwargs):
250250

251251
if ex is not None:
252252
status_kwargs["description"] = str(ex)
253+
span.record_exception(ex)
253254
span.set_status(Status(**status_kwargs))
254255

255256
@staticmethod

‎tests/opentelemetry-docker-tests/tests/celery/test_celery_functional.py

+6
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ def fn_task_parameters(user, force_logout=False):
249249
run_span.attributes.get("celery.task_name")
250250
== "test_celery_functional.fn_task_parameters"
251251
)
252+
assert len(run_span.events) == 0
252253

253254

254255
def test_fn_exception(celery_app, memory_exporter):
@@ -275,6 +276,11 @@ def fn_exception():
275276
== "test_celery_functional.fn_exception"
276277
)
277278
assert span.status.status_code == StatusCode.ERROR
279+
assert len(span.events) == 1
280+
event = span.events[0]
281+
assert event.name == "exception"
282+
assert event.attributes[SpanAttributes.EXCEPTION_TYPE] == "ExceptionInfo"
283+
assert SpanAttributes.EXCEPTION_MESSAGE in event.attributes
278284
assert (
279285
span.attributes.get(SpanAttributes.MESSAGING_MESSAGE_ID)
280286
== result.task_id

0 commit comments

Comments
 (0)
Please sign in to comment.