open-telemetry / opentelemetry-python-contrib

OpenTelemetry instrumentation for Python modules
https://opentelemetry.io
Apache License 2.0
701 stars 584 forks source link

Added recording of exceptions in Pyramid #2622

Closed rbagd closed 3 months ago

rbagd commented 3 months ago

Description

This PR adapts the instrumentation of Pyramid applications so that traces would contain information on uncaught exceptions or errors while serving a request. This is similar to what is done in the generic OpenTelemetryMiddleware for WSGI apps, which is not used in Pyramid instrumentation.

Fixes #2619

Type of change

How Has This Been Tested?

Unit tests added to ensure information on exceptions is present in generated traces. Only HTTP 5xx-like responses should generate such exceptions.

Does This PR Require a Core Repo Change?

Checklist:

See contributing.md for styleguide, changelog guidelines, and more.