You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Wire the section 11 GenAI metric instruments to the embedding event,
flipping proposal 0067 from partial to implemented.
- otel: _record_embedding_metrics records the same token.usage +
operation.duration histograms from the terminal EmbeddingEvent /
EmbeddingFailedEvent, with operation="embeddings" and input-only
tokens (an embedding call has no output tokens); duration every
call including a failure (error.type), token only when usage is
present.
- conformance: un-defer fixtures 089 (usage) and 143 (no-usage);
mark 0067 implemented. Rerank metrics (109) stay deferred, out of
scope per the proposal.
note = "OTel GenAI metrics (observability §11): an opt-in enable_metrics flag (default off, normative name) on the bundled OTelObserver, independent of span emission (§11.1). When on, two OA-namespaced histograms record per provider-call ATTEMPT from the python-internal LlmRetryAttemptEvent (the per-attempt LLM-span source since 0050): openarmature.gen_ai.client.token.usage ({token}; two observations -- input + output token counts from the response usage record, openarmature.gen_ai.token.type dim) and openarmature.gen_ai.client.operation.duration (s; once per attempt INCLUDING failed attempts, error.type dim on failure), both configured with the §11.2 explicit bucket advisories. Dimensions: openarmature.gen_ai.operation ('chat'), gen_ai.request.model + gen_ai.system (recognized-core, used directly), openarmature.gen_ai.token.type, error.type. The Meter comes from the configured MeterProvider (injectable; falls back to the OTel global, which is the no-op meter when none is set). PARTIAL: the embedding-call metrics (the §11 embedding path, fixture 089) are deferred -- the embedding capability (proposal 0059, observability §5.5.8 / §5.5.9) now ships (v0.16.0) and dispatches EmbeddingEvent, so the remaining gap is wiring the §11 metric instruments to the embedding event (they record from the LLM per-attempt event only today). The LLM path (fixtures 088 / 090 / 091) is implemented and wired via a private MeterProvider + InMemoryMetricReader (the §6.9 metric-capture primitive). No Langfuse change (metrics are OTel-only). Streaming / server / rerank metrics + the cutover to the upstream gen_ai.client.* instrument names are out of scope per the proposal."
652
+
status = "implemented"
653
+
since = "0.17.0"
654
+
note = "OTel GenAI metrics (observability §11): an opt-in enable_metrics flag (default off, normative name) on the bundled OTelObserver, independent of span emission (§11.1). When on, two OA-namespaced histograms record per provider-call ATTEMPT from the python-internal LlmRetryAttemptEvent (the per-attempt LLM-span source since 0050): openarmature.gen_ai.client.token.usage ({token}; two observations -- input + output token counts from the response usage record, openarmature.gen_ai.token.type dim) and openarmature.gen_ai.client.operation.duration (s; once per attempt INCLUDING failed attempts, error.type dim on failure), both configured with the §11.2 explicit bucket advisories. Dimensions: openarmature.gen_ai.operation ('chat'), gen_ai.request.model + gen_ai.system (recognized-core, used directly), openarmature.gen_ai.token.type, error.type. The Meter comes from the configured MeterProvider (injectable; falls back to the OTel global, which is the no-op meter when none is set). The §11 embedding-call metrics are now wired (v0.17.0): _record_embedding_metrics records the SAME two instruments from the terminal EmbeddingEvent / EmbeddingFailedEvent with operation='embeddings' and token.type='input' (an embedding call has input tokens only -- EmbeddingUsage.input_tokens, no output); duration records every embedding call including a failure (error.type), token.usage only when a usage record is present. Un-defers fixtures 089 (usage: token + duration) and 143 (no-usage: duration only, no token observation). The LLM path (fixtures 088 / 090 / 091) is implemented and wired via a private MeterProvider + InMemoryMetricReader (the §6.9 metric-capture primitive). No Langfuse change (metrics are OTel-only). Streaming / server / rerank metrics (fixture 109 stays deferred) + the cutover to the upstream gen_ai.client.* instrument names are out of scope per the proposal."
655
655
656
656
# Spec v0.57.0 (proposal 0068). Failure-isolation event structured cause
657
657
# chain (pipeline-utilities §6.3). ``caught_exception`` gains a ``chain`` of
0 commit comments