🐛 Bug Report: Incomplete cache token migration after #4243 breaks Bedrock and Groq instrumentation
Los mantenedores suelen responder en 1 día
@Quantum-Enigma-dot ya está trabajando en esto.
Desde el 29/10/2026.
- #4667 de @Quantum-Enigma-dot — abierto
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 76/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- python
- Área
- observability-sre
Línea de trabajo
Empieza con los archivos span_utils.py de Bedrock y Groq mencionados en el issue; después, busca en el repositorio las dos constantes de tokens de caché eliminadas y comprueba las definiciones actuales de GenAIAttributes. Ejecuta la prueba de prompt caching y las pruebas de span-utils de Groq indicadas en el informe. Se considera terminado cuando el uso de la caché se registre correctamente y las referencias restantes en tiempo de ejecución y en las pruebas ya no fallen frente a la fuente de semantic conventions del workspace.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Which component is this bug for?
Bedrock Instrumentation
📜 Description
The semantic-convention migration in #4243 removed the following attributes from SpanAttributes:
SpanAttributes.GEN_AI_USAGE_CACHE_READ_INPUT_TOKENSSpanAttributes.GEN_AI_USAGE_CACHE_CREATION_INPUT_TOKENS
However, the Bedrock and Groq instrumentations still reference these attributes in runtime code.
When a response contains prompt-cache usage data, accessing the removed attributes raises AttributeError. Several tests in Bedrock, Groq, Google Generative AI, and Mistral AI also continue to reference the removed attributes.
This appears to be an incomplete migration from SpanAttributes to GenAIAttributes.
👟 Reproduction steps
- Clone the repository and enter the Bedrock instrumentation package:
cd packages/opentelemetry-instrumentation-bedrock
2.Run the prompt-caching test using the workspace version of opentelemetry-semantic-conventions-ai:
uv run --group test python -c "import sys; sys.path.insert(0, '../opentelemetry-semantic-conventions-ai'); import pytest; sys.exit(pytest.main(['tests/traces/test_prompt_caching.py']))"
3.Alternatively, verify directly that the attributes are absent:
```python
from opentelemetry.semconv_ai import SpanAttributes
print(
hasattr(
SpanAttributes,
"GEN_AI_USAGE_CACHE_READ_INPUT_TOKENS",
)
)
# False
print(
hasattr(
SpanAttributes,
"GEN_AI_USAGE_CACHE_CREATION_INPUT_TOKENS",
)
)
# False
4.Bedrock still accesses the missing attributes inside converse_usage_record():
SpanAttributes.GEN_AI_USAGE_CACHE_READ_INPUT_TOKENS
SpanAttributes.GEN_AI_USAGE_CACHE_CREATION_INPUT_TOKENS
5.When cache usage is present, Python raises an AttributeError.
👍 Expected behavior
Bedrock and Groq should record prompt-cache token usage without raising an exception. All remaining references should use the current `GenAIAttributes` constants, or compatible aliases should remain available on `SpanAttributes` during the migration.
### 👎 Actual Behavior with Screenshots
When a cache-token code path accesses the removed constant, Python raises:
```text
AttributeError: type object 'SpanAttributes' has no attribute 'GEN_AI_USAGE_CACHE_READ_INPUT_TOKENS'
The Bedrock prompt-caching test also fails when run against the current workspace version of opentelemetry-semantic-conventions-ai:
```text
FAILED tests/traces/test_prompt_caching.py::test_invoke_model_cache_tokens
The Groq span-utils suite produces six failures involving the same missing cache-read attribute.
🤖 Python Version
3.13.7
📃 Provide any additional context for the Bug.
I traced the regression to #4243.
That migration moved the cache-token constants to GenAIAttributes and removed them from SpanAttributes. Several packages were migrated, but remaining runtime references in Bedrock and Groq were not updated.
The issue can be masked when package-specific environments resolve the previously published opentelemetry-semantic-conventions-ai==0.5.1, where the attributes are still available. Running the tests against the current workspace semantic-conventions source exposes the regression.
Relevant runtime locations include:
packages/opentelemetry-instrumentation-bedrock/opentelemetry/instrumentation/bedrock/span_utils.pypackages/opentelemetry-instrumentation-groq/opentelemetry/instrumentation/groq/span_utils.py
A possible fix is to migrate the remaining runtime and test references to GenAIAttributes. Alternatively, compatibility aliases could be restored on SpanAttributes if backward compatibility is intended.
I searched the repository history and existing reports but did not find a later fix for these remaining references. I am willing to submit a PR.
👀 Have you spent some time to check if this bug has been raised before?
- I checked and didn't find similar issue
Are you willing to submit PR?
Yes I am willing to submit a PR!
- Lenguaje dominante
- Python
- Estrellas
- 7.5k
- Forks
- 1.2k
- Merge medio
- 2 d 6 h
- PR fusionados (30 d)
- 2
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de traceloop/openllmetry
-
bug python
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
traceloop/openllmetry#4717 ·
Los mantenedores suelen responder en 1 día
-
🐛 Bug Report: OpenAI instrumentation drops gen_ai.usage.reasoning_tokens on streamed chat completionsPosiblemente ocupada @jayfeng7 la tomó hace 23 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
traceloop/openllmetry#4660 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Bug Report: Failed dataset deletes still remove local rows and columnsPosiblemente ocupada @inchang-ing la tomó hace 32 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
traceloop/openllmetry#4630 ·
Los mantenedores suelen responder en 1 día
-
🐛 Bug Report: LiteLLM instrumentation does not record seed, stop, frequency_penalty, presence_penaltyPosiblemente ocupada @shantam77 la tomó hace 38 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
traceloop/openllmetry#4598 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
🐛 Bug Report: LiteLLM instrumentation never ends the span when a call is interrupted (KeyboardInterrupt, asyncio cancellation)Posiblemente ocupada @rupak-eng la tomó hace 39 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
traceloop/openllmetry#4597 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de traceloop/openllmetry
Issues similares
-
Internal ErrorAbiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
frappe/frappe_docker#2071 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
The-Pocket/PocketFlow#161 ·
-
[Bug]: Webapp workspace fails to render in Safari — "Can't find variable: requestIdleCallback"Abiertocomp/desktop P2 type/bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
NousResearch/hermes-agent#157702 ·
Los mantenedores suelen responder en 1 día
-
scibench_physics / scibench_chemistry: a correct answer scores 0 when the unit has a power of tenPosiblemente ocupada @BahaaMattar la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
EvolvingLMMs-Lab/lmms-eval#1699 ·
Los mantenedores suelen responder en 1 día
-
project_inputs.html uses undefined file variable for dropdown IDs, lacks visual tag badges, and has empty delete labelsPosiblemente ocupada @Rucha0901 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
aboutcode-org/scancode.io#2354 ·
Los mantenedores suelen responder en 1 día