Repository navigation
Name the store holding the span a GenAI evaluation was judged from in traceRef.type - #14152
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Existing BanyanDB evaluation streams need additive boot reshape enabled to receive the new storage tag.
1 open issue
What changed in this PR
Records the actual span store on GenAI evaluations so clients can retrieve traces without guessing from the addressing type.
Changes:
- Propagates span storage through listeners, evaluation records, and all three storage query implementations.
- Adds unit tests and end-to-end checks for native, OTLP, and Zipkin ingestion.
- Documents storage selection and compatibility behavior.
| File | Description |
|---|---|
| test/e2e-v2/cases/zipkin-virtual-genai/expected/evaluation-storage.yml | Expects Zipkin storage. |
| test/e2e-v2/cases/zipkin-virtual-genai/evaluation-storage.yaml | Queries evaluation storage. |
| test/e2e-v2/cases/zipkin-virtual-genai/e2e.yaml | Enables storage verification. |
| test/e2e-v2/cases/zipkin-virtual-genai/docker-compose.yml | Enables the evaluation judge. |
| test/e2e-v2/cases/virtual-genai/expected/evaluation-storage.yml | Expects SkyWalking native storage. |
| test/e2e-v2/cases/virtual-genai/evaluation-storage.yaml | Queries evaluation storage. |
| test/e2e-v2/cases/virtual-genai/e2e.yaml | Enables storage verification. |
| test/e2e-v2/cases/otlp-virtual-genai/native/expected/evaluation-storage.yml | Expects native OTLP storage. |
| test/e2e-v2/cases/otlp-virtual-genai/native/evaluation-storage.yaml | Queries evaluation storage. |
| test/e2e-v2/cases/otlp-virtual-genai/native/e2e.yaml | Enables storage verification. |
| test/e2e-v2/cases/otlp-virtual-genai/expected/evaluation-storage.yml | Expects converted Zipkin storage. |
| test/e2e-v2/cases/otlp-virtual-genai/evaluation-storage.yaml | Queries evaluation storage. |
| test/e2e-v2/cases/otlp-virtual-genai/e2e.yaml | Enables storage verification. |
| oap-server/server-storage-plugin/storage-jdbc-hikaricp-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/jdbc/common/dao/JDBCGenAIEvaluationRecordQueryDAO.java | Reads the JDBC storage column. |
| oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/query/GenAIEvaluationRecordQueryEsDAO.java | Reads the Elasticsearch storage field. |
| oap-server/server-storage-plugin/storage-banyandb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/banyandb/stream/BanyanDBGenAIEvaluationRecordQueryDAO.java | Reads the BanyanDB storage tag. |
| oap-server/server-core/src/test/java/org/apache/skywalking/oap/server/core/analysis/manual/genai/GenAIEvaluationRecordTest.java | Tests persistence and fallback behavior. |
| oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/query/type/GenAITraceRef.java | Exposes trace storage. |
| oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/query/enumeration/GenAITraceStorage.java | Defines supported span stores. |
| oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/manual/genai/GenAIEvaluationRecord.java | Persists and resolves trace storage. |
| oap-server/analyzer/ai-evaluation/src/test/resources/gen-ai-config.yml | Supplies test provider rules. |
| oap-server/analyzer/ai-evaluation/src/test/java/org/apache/skywalking/oap/server/ai/evaluation/listener/AIEvaluationSpanListenerTest.java | Tests OTLP and Zipkin store assignment. |
| oap-server/analyzer/ai-evaluation/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/trace/parser/listener/GenAIEvaluationAnalysisListener.java | Assigns native segment storage. |
| oap-server/analyzer/ai-evaluation/src/main/java/org/apache/skywalking/oap/server/ai/evaluation/service/strategy/span/SpanAIEvaluationStrategy.java | Requires and persists storage metadata. |
| oap-server/analyzer/ai-evaluation/src/main/java/org/apache/skywalking/oap/server/ai/evaluation/listener/AIEvaluationSpanListener.java | Assigns OTLP or Zipkin storage. |
| oap-server/analyzer/ai-evaluation/src/main/java/org/apache/skywalking/oap/server/ai/evaluation/context/AIEvaluationContext.java | Carries storage through evaluation. |
| docs/en/setup/backend/ai-evaluation.md | Explains storage-based trace retrieval. |
| docs/en/changes/changes.md | Records the feature. |
Review effort: Balanced
|
Pushed 3fc0208 for two upgrade issues found in review. Both hit only storage that already holds evaluation records:
The push dismissed the approvals. @wankai123 @peachisai, could you take another look? |
|
If we don't need to preserve compatibility with evaluation records written before this change, could we extend traceRef.type with ZIPKIN instead of introducing a separate storage field?
|
3fc0208 to
b8ef2e3
Compare
… traceRef.type `traceRef.type` was the span's addressing scheme, so an `OTLP` reference could point into either the native OTLP store or the Zipkin store, and a client could not tell which one to read the trace from. GenAITraceRefType gains ZIPKIN, and each listener path records the store the span went to: OTLP for natively stored OTLP spans, ZIPKIN for spans received by receiver-zipkin or converted from OTLP with `otlpTraceStorage: zipkin`. The value goes into the existing `ref_type` column. The relatedTrace filters, the query validation and the evaluation span check switch on every type and reject an unknown one. The new mixed-virtual-genai e2e case judges spans from a SkyWalking agent, an OTLP exporter and a Zipkin exporter on one OAP, and checks that each record is found again through relatedTrace and names the only store holding its trace. The query protocol points at apache/skywalking-query-protocol#178 and #179.
b8ef2e3 to
aeed0eb
Compare
|
@peachisai Thanks, done in aeed0eb as you suggested:
Horizon UI needs a follow-up to open @wankai123 @peachisai, could you take another look? |
…d names OAP's evaluation traceRef.type now names the store holding the judged span (apache/skywalking#14152): SKYWALKING_NATIVE, OTLP (stored as OTLP, read through TraceQL's OTLP datasource) or ZIPKIN (the Zipkin receiver, or OTLP converted with otlpTraceStorage: zipkin). The Evaluation records tab follows it: a native trace opens on the native waterfall, an OTLP one on the TraceQL popout with the judged span selected, a Zipkin one on the Zipkin popout. Pick span... reads the same store, and the Trace store condition offers all three, matched exactly by OAP. A TraceQL trace read tells a missing store from a missing trace: a source with no TraceQL URL, and a 404 on the datasource path (a datasource OAP does not enable, or a context path Horizon has wrong), each say what to set. The TraceQL popout re-reads a trace still landing, as the native and Zipkin popouts do, and a view reused for another trace gets a fresh retry budget. e2e: OAP is pinned at the #14152 merge. The genai case adds TraceQL with the OTLP datasource, the Zipkin receiver and a caller exporting Zipkin, with readiness checks and specs for the OTLP and Zipkin stores. The core endpoint specs pick the fixture's endpoint by name: OAP now lists endpoints known only from logs or cross-thread spans (#14122), and those carry no endpoint metrics.

Name the store holding the span a GenAI evaluation was judged from in
traceRef.typetraceRef.typewas the span's addressing scheme, so anOTLPreference could point into two stores: OTLP spans stored as received (otlpTraceStorage: otlp, the default), and Zipkin spans, either received byreceiver-zipkinor converted from OTLP withotlpTraceStorage: zipkin.receiver-zipkinruns independently ofotlpTraceStorage, so one OAP can hold judged spans in both, and a client such as Horizon's Evaluation records tab had no way to tell which store to read the trace from. Probing the datasources cannot settle it either: the store is decided per span when it arrives, and changingotlpTraceStoragelater does not move earlier spans.As suggested in review,
GenAITraceRefTypegainsZIPKIN, so the type itself names the store:SKYWALKING_NATIVE,OTLPfor OTLP spans stored natively, orZIPKIN. The listener path that judges a span already knows where the span went:onNativeOTLPSpan→OTLP,onZipkinSpan→ZIPKIN, the native segment listener →SKYWALKING_NATIVE. The value goes into the existingref_typecolumn, so no storage schema changes.OTLPandZIPKINshare the trace ID + span ID addressing, whileSKYWALKING_NATIVEuses trace ID + segment ID + span index. TherelatedTracefilter in the BanyanDB, Elasticsearch and JDBC DAOs, the query validation, and the evaluation strategy's span check switch on every type and reject an unknown one. LLM-as-Judge is not in a release yet, so no stored record relies on the earlier meaning ofOTLP.Query protocol: apache/skywalking-query-protocol#178, which reverts #177, and #179, which fixes the
relatedTracecomment, both merged; the submodule points at35155de.If this is non-trivial feature, paste the links/URLs to the design doc.
Update the documentation to include this new feature.
Tests(including UT, IT, E2E) are added to verify the new feature.
ZIPKINfor a Zipkin span andOTLPfor a natively stored OTLP span; aZIPKINreference survives the record's storage round trip.evaluation-storagecheck in all four GenAI cases assertstraceRef.type:SKYWALKING_NATIVE(virtual-genai),ZIPKIN(otlp-virtual-genai, OTLP converted),OTLP(otlp-virtual-genai/native), andZIPKIN(zipkin-virtual-genai, which now runs the judge so thereceiver-zipkinpath is covered).otlp-virtual-genaievaluation span lookup is split per case, as the two cases store the span differently: the Zipkin-mode case looks the record up asZIPKIN, the native case asOTLP.mixed-virtual-genaicase runs one OAP with native OTLP storage,receiver-zipkin, the Zipkin query API and TraceQL, and judges spans from a SkyWalking-agent service, an OTLP exporter and a Zipkin exporter at the same time. For each source it checks that the newest record has the expected type, thatrelatedTracefinds the same span and a non-existent span finds nothing, and that only the store the type names holds the trace (SkyWalking trace query, TraceQL, Zipkin API).mixed-virtual-genai(4 cases),otlp-virtual-genai(24),otlp-virtual-genai/native(24),virtual-genai(28),zipkin-virtual-genai(23).If it's UI related, attach the screenshots below.
If this pull request closes/resolves/fixes an existing issue, replace the issue number. Closes #.
Update the
CHANGESlog.