Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Partial celery task time limit is not support #846

Closed
OHeimlich opened this issue Jan 9, 2022 · 0 comments · Fixed by #847
Closed

Partial celery task time limit is not support #846

OHeimlich opened this issue Jan 9, 2022 · 0 comments · Fixed by #847
Labels
bug Something isn't working

Comments

@OHeimlich
Copy link
Contributor

Python 3.8

Steps to reproduce

  • Create celery task with only one of the time limit soft/hard
    Or use this test to reproduce:

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

    def test_set_attributes_partial_timelimit_hard_limit(self):
        context = {
            "correlation_id": "44b7f305",
            "delivery_info": {"eager": True},
            "eta": "soon",
            "expires": "later",
            "hostname": "localhost",
            "id": "44b7f305",
            "reply_to": "44b7f305",
            "retries": 4,
            "timelimit": ("now", None),
            "custom_meta": "custom_value",
            "routing_key": "celery",
        }
        span = trace._Span("name", mock.Mock(spec=trace_api.SpanContext))
        utils.set_attributes_from_context(span, context)
        self.assertEqual(span.attributes.get("celery.timelimit"), ("now", ""))

What is the expected behavior?
The time limit that was specify should be instrumented

What is the actual behavior?
Exception is raised and no time limit is instrumented

[__init__.py:_translate_attributes:164] _translate_key_values(key, value)
exception.trace.1	
[exporter.py:_translate_key_values:126] return KeyValue(key=key, value=_translate_value(value))
exception.trace.2	
[ exporter.py:_translate_value:104] array_value=ArrayValue(values=[_translate_value(v) for v in value])
exception.trace.3	
[ exporter.py:<listcomp>:104] array_value=ArrayValue(values=[_translate_value(v) for v in value])
exception.trace.4	
[ exporter.py:_translate_value:119] "Invalid type {} of value {}".format(type(value), value)
@OHeimlich OHeimlich added the bug Something isn't working label Jan 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant