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

Errors from Celery tasks are all reported as ExceptionInfo making grouping bad #76

Closed
tombruijn opened this issue Jun 15, 2023 · 2 comments · Fixed by open-telemetry/opentelemetry-python-contrib#1863
Assignees
Labels

Comments

@tombruijn
Copy link
Member

All Celery errors, even custom errors, seem to be reported as "ExceptionInfo" by OpenTelemetry:
Not a blocker for me right now, but something to be aware off and most certainly will have someone pop up in support about. This is something I think should be fixed in the Celery instrumentation, as that's what's reporting it with this wrapper error.

2023-06-15 09-26-24 Errors - pythondjango4-celery - AppSignal

OpenTelemetry payload

{
events: {
  time_unix_nano: 1686813462797997050,
  name: "exception",
  attributes: {
    key: "exception.type",
    value: {
      string_value: "ExceptionInfo",
    },
  },
  attributes: {
    key: "exception.message",
    value: {
      string_value: "Traceback (most recent call last):\n  File \"/usr/local/lib/python3.11/site-packages/celery/app/trace.py\", line 477, in trace_task\n    R = retval = fun(*args, **kwargs)\n                 ^^^^^^^^^^^^^^^^^^^^\n  File \"/usr/local/lib/python3.11/site-packages/celery/app/trace.py\", line 760, in __protected_call__\n    return self.run(*args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/app/tasks.py\", line 43, in custom_error_task\n    raise MyCeleryException(\"Custom Celery error\")\ntasks.MyCeleryException: Custom Celery error\n",
    },
  },
  attributes: {
    key: "exception.stacktrace",
    value: {
      string_value: "Traceback (most recent call last):\n  File \"/usr/local/lib/python3.11/site-packages/celery/app/trace.py\", line 477, in trace_task\n    R = retval = fun(*args, **kwargs)\n                 ^^^^^^^^^^^^^^^^^^^^\n  File \"/usr/local/lib/python3.11/site-packages/celery/app/trace.py\", line 760, in __protected_call__\n    return self.run(*args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/app/tasks.py\", line 43, in custom_error_task\n    raise MyCeleryException(\"Custom Celery error\")\ntasks.MyCeleryException: Custom Celery error\n",
    },
  },
  attributes: {
    key: "exception.escaped",
    value: {
      string_value: "False",
    },
  },
},
status: {
  message: "Traceback (most recent call last):\n  File \"/usr/local/lib/python3.11/site-packages/celery/app/trace.py\", line 477, in trace_task\n    R = retval = fun(*args, **kwargs)\n                 ^^^^^^^^^^^^^^^^^^^^\n  File \"/usr/local/lib/python3.11/site-packages/celery/app/trace.py\", line 760, in __protected_call__\n    return self.run(*args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/app/tasks.py\", line 43, in custom_error_task\n    raise MyCeleryException(\"Custom Celery error\")\ntasks.MyCeleryException: Custom Celery error\n",
  code: STATUS_CODE_ERROR
},
}
@tombruijn
Copy link
Member Author

@tombruijn
Copy link
Member Author

This issue was fixed by the upstream PR open-telemetry/opentelemetry-python-contrib#1863. It's not been released yet, but once it is, it should be a matter of upgrading the opentelemetry-instrumentation-celery package. Closing this issue as it's fixed (but not yet released).

We'll have a look at if we can require a certain version of dependencies in #126.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants