Przejdź do treści
Biblioteka skilli
DevOps i chmura · Przegląd i audyt

validate-genai-spans

/validate-genai-spans

Sprawdza, czy spany trace'ów LLM zawierają pełne pola zgodne ze specyfikacją OTel GenAI.

Licencja
CC0-1.0
Ostatnia zmiana repozytorium
26.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
3
Skrypty
2
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 26.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

CC0-1.0, otwarta.

Co sprawdzić przed instalacją
  • 2 skrypty w paczce. Przejrzyj je przed instalacją, bo Claude może je uruchomić.

Skrypty: scripts/validate_span.py, tests/test_validate_span.py

Co robi i kiedy

Sprawdza, czy spany trace'ów LLM zawierają pełne pola zgodne ze specyfikacją OTel GenAI.

Wyzwalacze z opisu

are my traces completevalidate my instrumentationmy spans are missing fieldslint my OTel GenAI spanstest my tracing
Oryginalny opis (EN)

Use this to check that your LLM tracing actually emits complete, spec-compliant spans, so cost/latency/model dashboards downstream are not full of holes. Trigger on "are my traces complete", "validate my instrumentation", "my spans are missing fields", "lint my OTel GenAI spans", "test my tracing". Ships a runnable, tested validator you can drop into your instrumentation tests.

Jak działa

  1. Use the bundled script
  2. How to apply it
  3. Validation
  4. Anti-patterns
Sekcje z nagłówków SKILL.md, w oryginale · 37 linii, 284 słów
Podgląd SKILL.md
---
name: validate-genai-spans
description: Use this to check that your LLM tracing actually emits complete, spec-compliant spans, so cost/latency/model dashboards downstream are not full of holes. Trigger on "are my traces complete", "validate my instrumentation", "my spans are missing fields", "lint my OTel GenAI spans", "test my tracing". Ships a runnable, tested validator you can drop into your instrumentation tests.
license: CC0-1.0
---

# Validate GenAI spans

Broken instrumentation fails silently: the app works, the dashboards just quietly miss the model, the tokens, or the cost. This skill ships a validator that asserts your spans carry the required OpenTelemetry `gen_ai.*` fields, so you catch gaps in a test instead of in a half-empty dashboard.

## Use the bundled script

[`scripts/validate_span.py`](scripts/validate_span.py) is pure Python, no install needed:

```python
from validate_span import validate_gen_ai_span, is_valid_gen_ai_span

problems = validate_gen_ai_span(span_attributes)          # [] means valid
validate_gen_ai_span(span_attributes, strict=True)        # also flag recommended fields
assert is_valid_gen_ai_span(span_attributes)              # use in an instrumentation test
```

It checks the required fields (`gen_ai.provider.name`, `gen_ai.operation.name`, `gen_ai.request.model`) and, in strict mode, the recommended usage fields (`gen_ai.usage.input_tokens`/`output_tokens`, `gen_ai.response.model`) that cost analysis depends on. Spans still using the pre-2025 `gen_ai.system` name pass but get a deprecation note, so you can migrate at your own pace.

## How to apply it

1. **Add an instrumentation test:** capture the span your app emits for a sample call (most SDKs have an in-memory span exporter for tests) and assert `is_valid_gen_ai_span(attrs)`.
2. **Run it in CI** so a change that breaks instrumentation fails the build, not production.
3. **Use strict mode** once basic spans pass, to push toward full cost/usage coverage.

Pairs with `instrument-llm-observability` (which gets the spans emitted in the first place).

## Validation

Run the tests: `pytest skills/validate-genai-spans/tests/`. They cover a valid span, each missing required field, empty/wrong-typed values, the deprecated `gen_ai.system` alias, strict-mode recommended checks, and non-dict input.

## Anti-patterns

- Assuming "traces show up" means they are complete (missing token fields break cost dashboards).
- Only checking spans by eye once, instead of asserting them in CI.
- Ignoring the response model id (you cannot break cost down by served model without it).
Pliki w paczce (3)
  • SKILL.md 3 KB
  • scripts/validate_span.py 3 KB
  • tests/test_validate_span.py 2 KB

Wersje

W bazie nie ma innych skilli o nazwie validate-genai-spans.

Migawka bazy z 13.11.2026 · wersja paczki b58c0bbc2d67 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100dt-setup-genai
    Prowadzi przez cztery kroki instrumentacji aplikacji GenAI, tak by emitowała spany gen_ai.* w OpenTelemetry widoczne w Dynatrace.
  • 91otel-verify
    Sprawdza deterministycznie istniejącą instrumentację OpenTelemetry: spany, metryki i logi, i tworzy raport.
  • 91otel-verify
    Weryfikuje istniejącą instrumentację OpenTelemetry deterministycznie i tworzy raport: spany, metryki i logi, z pokryciem poszczególnych ścieżek kodu.
  • 100vercel-tracing
    Konfiguruje instrumentację OpenTelemetry dla Vercel Tracing i pozwala przeszukiwać spany: @vercel/otel, hooki startu frameworków, własne spany, propagacja kontekstu i vercel traces.
  • 100otel-instrumentation
    Konfiguruje spany śladów, własne metryki, eksportery logów i strategie próbkowania w instrumentacji OpenTelemetry aplikacji.
  • 100vercel-tracing
    Konfiguruje instrumentację OpenTelemetry dla Vercel Tracing i przeszukuje spany przez CLI, także dla Next.js i popularnych bibliotek.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.