Skip to content

Commit d6f5fa1

Browse files
committed
change attr name to use_span_links and remove dupe changelog block
1 parent 4f1eda6 commit d6f5fa1

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

CHANGELOG.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111
1212
## Unreleased
1313

14-
### Added
15-
16-
- `opentelemetry-instrumentation-celery`: Add `use_links` parameter to allow creating span links instead of parent-child relationships between task creation and execution spans.
17-
([#3002](https://github.com/open-telemetry/opentelemetry-python-contrib/issues/3002))
18-
1914
### Fixed
2015

2116
- `opentelemetry-instrumentation-dbapi`: fix crash retrieving libpq version when enabling commenter with psycopg
@@ -30,6 +25,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3025
([#3777](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3777))
3126
- `opentelemetry-exporter-credential-provider-gcp`: create this package which provides support for supplying your machine's Application Default Credentials (https://cloud.google.com/docs/authentication/application-default-credentials) to the OTLP Exporters created automatically by OpenTelemetry Python's auto instrumentation. These credentials authorize OTLP traces to be sent to `telemetry.googleapis.com`.
3227
[#3766](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3766).
28+
- `opentelemetry-instrumentation-celery`: Add `use_span_links` parameter to allow creating span links instead of parent-child relationships between task creation and execution spans.
29+
([#3002](https://github.com/open-telemetry/opentelemetry-python-contrib/issues/3002))
3330

3431
## Version 1.37.0/0.58b0 (2025-09-11)
3532

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def add(x, y):
5252
5353
The ``CeleryInstrumentor().instrument()`` method accepts the following arguments:
5454
55-
* ``use_links`` (bool): When ``True``, Celery task execution spans will be linked to the
55+
* ``use_span_links`` (bool): When ``True``, Celery task execution spans will be linked to the
5656
task creation spans instead of being created as child spans. This provides a looser
5757
coupling between spans in distributed systems. Defaults to ``False`` to maintain
5858
backward compatibility.
@@ -132,7 +132,7 @@ def instrumentation_dependencies(self) -> Collection[str]:
132132

133133
def _instrument(self, **kwargs):
134134
tracer_provider = kwargs.get("tracer_provider")
135-
use_links = kwargs.get("use_links", False)
135+
use_span_links = kwargs.get("use_span_links", False)
136136

137137
# pylint: disable=attribute-defined-outside-init
138138
self._tracer = trace.get_tracer(
@@ -142,7 +142,7 @@ def _instrument(self, **kwargs):
142142
schema_url="https://opentelemetry.io/schemas/1.11.0",
143143
)
144144
# pylint: disable=attribute-defined-outside-init
145-
self._use_links = use_links
145+
self._use_span_links = use_span_links
146146

147147
meter_provider = kwargs.get("meter_provider")
148148
meter = get_meter(
@@ -188,7 +188,7 @@ def _trace_prerun(self, *args, **kwargs):
188188

189189
operation_name = f"{_TASK_RUN}/{task.name}"
190190

191-
if self._use_links and tracectx is not None:
191+
if self._use_span_links and tracectx is not None:
192192
parent_span_context = trace.get_current_span(
193193
tracectx
194194
).get_span_context()

instrumentation/opentelemetry-instrumentation-celery/tests/test_tasks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,8 @@ def _retrieve_context_wrapper_none_token(
222222

223223
unwrap(utils, "retrieve_context")
224224

225-
def test_task_use_links(self):
226-
CeleryInstrumentor().instrument(use_links=True)
225+
def test_task_use_span_links(self):
226+
CeleryInstrumentor().instrument(use_span_links=True)
227227

228228
result = task_add.delay(1, 2)
229229

0 commit comments

Comments
 (0)