@@ -4,19 +4,9 @@ applyTo: "instrumentation-genai/**"
44
55Review rules for PRs touching ` instrumentation-genai/** ` . Flag violations with a link to the rule.
66
7- ## 0. Reviewer mindset
8-
9- Review as long-term maintainer.
10-
11- For new instrumentations, consult upstream library docs and judge:
12-
13- - Does the library already emit its own telemetry, making this instrumentation redundant?
14- - Is the library used widely enough to warrant a package in this repo?
15- - Does it avoid unbounded in-memory accumulation or other side-effects?
16- - Does the library raise exceptions that would reach user code through our wrapping?
17-
18- For changes to existing instrumentations: prefer back-compat. Break users only for a real reason;
19- prefer opt-in or additive. Breaking changes need explicit justification in the PR.
7+ These rules are additive to
8+ [ ` instrumentation.instructions.md ` ] ( instrumentation.instructions.md ) , which applies to all
9+ instrumentation packages.
2010
2111## 1. Scope of ` instrumentation-genai/ `
2212
@@ -29,14 +19,11 @@ Only for:
2919Database clients (including vector DBs used outside a GenAI-specific client) and CLI libs belong
3020in ` instrumentation/ ` , not here.
3121
32- ## 2. Component ownership & maintenance commitment
22+ ## 2. GenAI component ownership
3323
34- - New instrumentations must add an entry under the correct folder in
35- [ ` component_owners.yml ` ] ( ../component_owners.yml ) in the same PR. Contributor must commit to
36- long-term maintenance. See
37- [ Expectations from contributors] ( ../../CONTRIBUTING.md#expectations-from-contributors ) ,
38- [ Guideline for GenAI instrumentations] ( ../../CONTRIBUTING.md#guideline-for-genai-instrumentations ) ,
39- and the general [ instrumentation checklist] ( ../../CONTRIBUTING.md#guideline-for-instrumentations ) .
24+ See [ ` CONTRIBUTING.md#guideline-for-genai-instrumentations ` ] ( ../../CONTRIBUTING.md#guideline-for-genai-instrumentations )
25+ for GenAI-specific maintenance expectations on top of the general
26+ [ instrumentation checklist] ( ../../CONTRIBUTING.md#guideline-for-instrumentations ) .
4027
4128## 3. Telemetry and configuration via ` opentelemetry-util-genai `
4229
@@ -49,44 +36,29 @@ in `instrumentation/`, not here.
4936- Adding attributes to invocations produced by the util is fine.
5037- If a capability is missing in ` opentelemetry-util-genai ` , land it in the util first.
5138
52- ## 4. Semantic conventions
39+ ## 4. GenAI semantic conventions
5340
5441- Attributes, spans, events, and metrics must match the
5542 [ GenAI semantic conventions] ( https://github.com/open-telemetry/semantic-conventions/tree/main/docs/gen-ai ) .
56- - If a signal is not in semconv, wait until semconv lands.
57- - Attribute names must come from the semconv attribute modules, not hardcoded strings:
58- - ` gen_ai.* ` : ` opentelemetry.semconv._incubating.attributes.gen_ai_attributes `
59- - ` server.* ` : ` opentelemetry.semconv.attributes.server_attributes `
60- - ` error.* ` : ` opentelemetry.semconv.attributes.error_attributes `
61- - other namespaces: corresponding module under ` opentelemetry.semconv `
62- - For attributes with a well-known value set in semconv, use the generated enum from the same
63- modules (e.g. ` GenAiOutputTypeValues ` for ` gen_ai.output.type ` ) instead of string literals.
64-
65- ## 5. Exception handling
66-
67- - No ` raise ` statements in instrumentation/telemetry code. Validation belongs in tests and
68- callers.
69- - When catching library exceptions to record telemetry, re-raise the original exception
70- unmodified.
43+ - ` gen_ai.* ` attribute names must come from
44+ ` opentelemetry.semconv._incubating.attributes.gen_ai_attributes ` .
45+ - For attributes with a well-known value set, use the generated enum from the same module
46+ (e.g. ` GenAiOutputTypeValues ` for ` gen_ai.output.type ` ) instead of string literals.
7147
72- ## 6 . Tests
48+ ## 5 . Tests
7349
7450- Use recorded VCR cassettes for provider calls. No live-key-only tests; skipping on missing key
7551 is not acceptable.
76- - For every public API touched, cover sync/async and streaming/non-streaming variants when both
77- exist.
78- - Cover happy path and error scenarios, at minimum: provider error / endpoint unavailable, stream
52+ - Cover streaming and non-streaming variants when both exist.
53+ - For error scenarios, at minimum include: provider error / endpoint unavailable, stream
7954 interrupted by network, stream closed early by the caller.
80- - Tests must verify exact attribute names ** and value types** , checked against the semconv spec.
81- - Test against oldest and latest supported library versions via ` tests/requirements.{oldest,latest}.txt `
82- and ` {oldest,latest} ` ` tox.ini ` factors (see existing GenAI packages).
8355
84- ## 7 . Examples
56+ ## 6 . Examples
8557
8658New instrumentations must ship a minimal example under the package's ` examples/ ` , with both a
8759` manual/ ` and a ` zero-code/ ` (auto-instrumentation) variant.
8860
89- ## 8 . PR description
61+ ## 7 . PR description
9062
9163- Cover which part of the GenAI semconv the change implements or follows (when applicable) and
9264 how instrumentations should consume it.
0 commit comments