semantic-conventions-genai
AGENTS.md528 starsChanged 41 days agoApache-2.0View on GitHub
OpenTelemetry GenAI semantic conventions: spans, metrics, and events for GenAI clients, MCP, and provider-specific conventions. Attributes live in model/<namespace>/registry.yaml; signals in model/<namespace>/{spans,metrics,events}.yaml. Human docs are in docs/gen-ai/; runnable proofs in reference/. 1. Be concise. Short brief/note text. Small, focused PRs — phase large changes across several. 2. Be actionable. Tell instrumentation authors how to collect telemetry and consumers how to interpret it. Keep justification out of the conventions — put it in the PR description. 3. Use this repo's terminology.…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,774 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository5 other files it gives its agents.
- reference/AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- pr-descriptionSkill
- referenceSkill
- unslopSkill
The file
We split this AGENTS.md into the rules it gives an agent
3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 18
No attribute without a signal: Every attribute added must be referenced by a span, metric, or event that defines when and how it is …
- Distinctive: line 31
Investigate breadth first: Before adding a convention, survey the libraries/frameworks it applies to and the terminology and primitives …
- Distinctive: line 34
Don't over-abstract: If a broadly-applicable convention gets too abstract to be useful, prefer concrete framework-specific conventions over …
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
OpenTelemetry GenAI semantic conventions: spans, metrics, and events for
GenAI clients, MCP, and provider-specific conventions. Attributes live in
model/<namespace>/registry.yaml; signals in model/<namespace>/{spans,metrics,events}.yaml. Human docs are in docs/gen-ai/; runnable proofs in reference/.
How to contribute conventions
- Be concise. Short
brief/notetext. Small, focused PRs — phase large changes across several. - Be actionable. Tell instrumentation authors how to collect telemetry and consumers how to interpret it. Keep justification out of the conventions — put it in the PR description.
- Use this repo's terminology. Reuse the established vocabulary —
operation, span, attribute, signal, inference, embeddings,
execute tool, invoke agent (client vs internal), plan, memory,
retrieval, workflow — and existing
gen_ai.*attribute names. When introducing a new concept, explain it and show how it maps across libraries and frameworks. - No attribute without a signal. Every attribute added must be referenced by a span, metric, or event that defines when and how it is recorded. No orphan attributes.
- No convention without a reference scenario. A new convention
needs a
reference/scenarios/<library>/scenario that emits it, with every emitted value readable from inside the library: a parameter it interprets, a return value, exception, or library state. See reference/CONTRIBUTING.md. - Only model what generic instrumentation can record at runtime. A reference scenario must plausibly show how generic instrumentation captures the telemetry from information available to it at runtime. If it isn't instrumentable, don't propose conventions — open an issue and bring it to the GenAI SIG or #otel-genai-instrumentation.
- Investigate breadth first. Before adding a convention, survey the libraries/frameworks it applies to and the terminology and primitives they use. Propose something that works broadly across them, not for one SDK.
- Don't over-abstract. If a broadly-applicable convention gets too abstract to be useful, prefer concrete framework-specific conventions over a forced generic concept.
- Stay in the GenAI domain. This repo holds GenAI-related conventions. If a proposal is broader than GenAI, take it to open-telemetry/semantic-conventions.
Workflow
make generate-all # regenerate registry docs, embedded tables, reports — run after editing model
make test-json-schemas # validate sample documents against model/gen-ai/*.json; see docs/gen-ai/non-normative/tests/README.md
cd reference
uv run run-scenario <library> # or --all; runs scenario, validates telemetry, writes data.jsonCI fails if committed generated output doesn't match make generate-all. Add a
Towncrier fragment under changelog.d/ for any consumer-visible
change. See CONTRIBUTING.md.
For PRs that change semantic conventions, use the reference
skill in .github/skills/reference/SKILL.md. For reviews
of reference coverage and capturability, see the
evaluation rubric in
.github/instructions/evaluate-reference.instructions.md -
an instruction file that applies automatically to model, docs, and scenario
changes, not a skill to invoke.
Further reading
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

