[OPIK-7496] [BE] fix: strip otel attribute rule prefix from saved key#7499
Conversation
|
Thank you for the review @andrescrz |
andrescrz
left a comment
There was a problem hiding this comment.
Hi @albe2669
I left follow-up comments on one of the open discussions and also some additional feedback.
The main issue is that CI is failing, and it seems caused by changes related to this PR. Some tests in OpenTelemetryResourceTest seems to be the failing.
Please take a look and make sure the new code doesn't cause any regression.
I'll review once the fixes are in place.
Thanks a lot for your contribution.
e9062f8 to
6b68657
Compare
andrescrz
left a comment
There was a problem hiding this comment.
Hi @albe2669
Thanks for the contribution! I reviewed the PR and everything looks good from my side. I've approved it, and all CI checks have passed successfully.
We'll merge it shortly, and the change will be included in the next Opik release.
Thanks again for contributing to Opik!
Details
In the otel ingestion endpoint there are a few prefix attributes:
outputopik.metadatagen_ai.usagegen_ai.inputgen_ai.outputgen_ai.toolgen_ai.agentgen_ai.requestgen_ai.responseWhich map into input, output or metadata. When matching the prefix rule the
enrichSpanAttributesmethod sets the value in the respective bucket to the attribute key. This means that the attribute:output: {"choices": [...]}, will be parsed as{"output": {"choices": [...]}}. Similarly,output.choices: [...]would parse as the same thing.This PR strips the prefix of the matched rule, if the outcome is
INPUT,OUTPUTorMETADATA. This will allow an OpenTelemetry trace to produce a trace that is significantly closer to a native Opik trace.Change checklist
Issues
AI-WATERMARK
AI-WATERMARK: [no]
Testing
mvn test