Observability with OpenTelemetry¶
pip install tierproxy[otel]
import tierproxy
tierproxy.enable_telemetry(
service_name="my-scraper",
endpoint="http://otel-collector:4317", # or set OTEL_EXPORTER_OTLP_ENDPOINT env
resource_attributes={"deployment.env": "prod"},
)
with tierproxy.TierProxy() as t:
me = t.me.get()
# Span emitted with attrs: http.method=GET, http.url=..., tierproxy.upstream=...
Attributes per span:
Attribute |
Value |
|---|---|
|
from |
|
GET / POST / etc |
|
full request URL |
|
from request kwargs |
|
sticky session ID if set |
|
resolved upstream id |
Compatible with: Datadog APM, Honeycomb, Grafana Tempo, Jaeger, AWS X-Ray, any OTLP receiver.