Files
Kaustubh 38039bf5bf cookbook: add Confident AI observability example (#10257)
## Summary

Adds a runnable observability cookbook for [Confident
AI](https://www.confident-ai.com/) using its OpenTelemetry-native
`confident-trace` SDK, which detects Agno automatically.

- Add `cookbook/observability/confident_ai.py`: calls `init()` once at
startup, runs a Hacker News agent (OpenAIResponses, `gpt-5.6-luna`)
twice, wraps the second run in `trace_context` to attach tags, metadata,
and a user ID, and calls `shutdown()` in a `finally` block to flush
spans.
- List the example in `cookbook/observability/README.md`.
- Record the test run in `cookbook/observability/TEST_LOG.md`.

Companion docs: agno-agi/docs#767 (Mintlify) and agno-agi/agno-docs#141
(in-house). The in-house examples page links to this cookbook on `main`.

## Type of change

- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [x] Improvement
- [ ] Model update
- [ ] Other:

---

## Checklist

- [x] Code complies with style guidelines
- [x] Ran format/validation scripts (`./scripts/format.sh` and
`./scripts/validate.sh`)
- [x] Self-review completed
- [x] Documentation updated (comments, docstrings)
- [x] Examples and guides: Relevant cookbook examples have been included
or updated (if applicable)
- [x] Tested in clean environment
- [ ] Tests added/updated (if applicable)

### Duplicate and AI-Generated PR Check

- [x] I have searched existing [open pull
requests](https://github.com/agno-agi/agno/pulls) and confirmed that no
other PR already addresses this issue
- [ ] If a similar PR exists, I have explained below why this PR is a
better approach
- [x] Check if this PR was entirely AI-generated (by Copilot, Claude
Code, Cursor, etc.)

---

## Additional Notes

- Verified against `confident-trace==0.1.3`. Its OpenAI integration
patches the Responses API, so `OpenAIResponses` model spans are captured
alongside the Agno agent and tool spans.
- Ran end to end with `CONFIDENT_API_KEY` and `OPENAI_API_KEY` set. Both
runs completed and span batches were accepted by the collector with HTTP
200.
- `CONFIDENT_OTEL_ENDPOINT` must match the project's region. A US
project key sent to the EU endpoint returns 401 on export, so only set
it for EU projects. The module docstring calls this out.
- `cookbook/scripts/check_cookbook_pattern.py` passes for the new file.
The two existing violations it reports in `mlflow_via_autolog.py` are
pre-existing and untouched.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2026-09-17 14:12:48 +05:30
..

Observability

Observability examples for tracing and monitoring Agno agents, teams, and workflows.

Root Integrations

  • agent_ops.py
  • arize_phoenix_moving_traces_to_different_projects.py
  • arize_phoenix_via_openinference.py
  • arize_phoenix_via_openinference_local.py
  • atla_op.py
  • confident_ai.py
  • langfuse_via_openinference.py
  • langfuse_via_openinference_response_model.py
  • langfuse_via_openlit.py
  • langsmith_via_openinference.py
  • langtrace_op.py
  • langwatch_op.py
  • latitude_via_openinference.py
  • logfire_via_openinference.py
  • mlflow_via_openinference.py
  • maxim_ops.py
  • opik_via_openinference.py
  • the_context_company.py
  • trace_to_database.py
  • traceloop_op.py
  • weave_op.py

Subdirectories

  • teams: Multi-agent team tracing examples.
  • workflows: Workflow tracing examples.

Run

.venvs/demo/bin/python cookbook/observability/<file>.py