feat: add native OpenTelemetry instrumentation

Open spans directly on the user's thread so that stdlib log records
emitted during hot paths like `Crew.kickoff`, `BaseTool.run`, and
`LLM.call` carry the active trace context and correlate with the
spans they belong to — a gap the previous metrics-only telemetry
could not close. Introduces a `crewai.telemetry.otel` module
exposing `operation` and `follows_from`, instruments the execution
hot paths, and propagates the active context across every
parallel-dispatch site. Depends only on `opentelemetry-api` so
provider and exporter choice stays with the host application per the
standard OTel library pattern; without an installed SDK the
`ProxyTracer` keeps everything as a NoOp.
This commit is contained in:
Lucas Gomide
2026-06-22 15:58:39 -03:00
parent 4cbfbdb232
commit fb4b2afb77
27 changed files with 1637 additions and 515 deletions

View File

@@ -327,6 +327,7 @@
"pages": [
"edge/en/observability/tracing",
"edge/en/observability/overview",
"edge/en/observability/opentelemetry",
"edge/en/observability/arize-phoenix",
"edge/en/observability/braintrust",
"edge/en/observability/datadog",