Instruments Pyramid web applications to automatically capture telemetry data and traces. Use this to monitor performance and request flows in Python web services.
# Source: https://github.com/open-telemetry/opentelemetry-python-contrib | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
# Provided via justclaw.it.com; keep this notice with the code.
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
import wsgiref.util as wsgiref_util
from logging import getLogger
from time import time_ns
from timeit import default_timer
from pyramid.events import BeforeTraversal
from pyramid.httpexceptions import HTTPException, HTTPServerError
from pyramid.settings import asbool
from pyramid.tweens import EXCVIEW
import opentelemetry.instrumentation.wsgi as otel_wsgi
from opentelemetry import context, trace
from opentelemetry.instrumentation._semconv import (
HTTP_DURATION_HISTOGRAM_BUCKETS_N
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key