-
[OPIK-3295] [BE]Spring AI OpenTelemetry integration fix to display tags and metadata with latest version of the library (#4277)
发布于
2025-12-04 18:04:59 +00:00 - [OPIK-3295] [BE] Enhance OpenTelemetry mapping utilities and tests to support usage field extraction
- Introduced
extractUsageFieldand related helper methods inOpenTelemetryMappingUtilsfor advanced usage extraction. - Added usage key mapping and JSON object handling for
input_tokens,output_tokens, and nested usage data. - Refactored
OpenTelemetryMapperto delegate usage field processing toOpenTelemetryMappingUtils. - Extended unit tests in
OpenTelemetryMappingUtilsTestfor comprehensive validation of usage extraction scenarios, including fallback logic and error handling.
- [OPIK-3321] [BE] Add new OpenTelemetry mapping rules for GenAI metadata handling
- Added
temperature,response.id,finish_reasons, andoperation.namerules to enhance metadata extraction. - Expanded GenAI rules for improved span and telemetry mapping logic.
- [OPIK-3337] [BE] Add OpenTelemetry mapping rules for tags extraction and metadata support
- Introduced new mapping rules for
opik.tagsandopik.metadatato enhance attribute processing. - Implemented
extractTagsinOpenTelemetryMappingUtilsfor robust tag extraction from various formats. - Updated
OpenTelemetryMapperto handle tag and metadata mapping. - Extended unit tests in
OpenTelemetryMappingUtilsTestto validateextractTagsfunctionality across diverse scenarios.
- [OPIK-3452] [BE] Update RandomUtils method usage in OpenTelemetryResourceTest
- Replaced deprecated
nextIntwithrandomIntfor generating batch sizes in unit tests.
- [OPIK-3295] [BE] Enhance OpenTelemetry metadata mapping logic
- Added prefix support for
opik.metadatarule to allow dynamic key matching. - Updated unit tests in
OpenTelemetryResourceTestto include validation for prefixed metadata keys and new inline values.
- [OPIK-3478] [BE] Refactor OpenTelemetry mapping and tagging utilities
- Cleaned up JSON object handling logic in
OpenTelemetryMappingUtilsto simplify usage extraction and improve fallback handling. - Updated access modifiers for helper methods (
tryExtractUsageFromString,tryExtractUsageFromJsonObject) for better encapsulation. - Improved debug logging across
OpenTelemetryMappingUtilsfor enhanced error traceability. - Applied formatting fixes and improved readability in
OpenTelemetryMapperand related tests. - Adjusted and expanded unit tests in
OpenTelemetryResourceTestandOpenTelemetryMappingUtilsTestto validate updated logic.
- [OPIK-3295] [DOCS] Update Spring AI integration with Opik
- Added detailed setup steps, including prerequisites, environment variables, and installation instructions.
- Introduced multiple methods to run the demo application.
- Updated sample configuration files and example code to enhance clarity.
- Included instructions for testing the demo application with REST API requests.
- Added new image
springai_opentelemetry_integration.pngto showcase Opik traces.
-
Optimised images with calibre/image-actions
-
[OPIK-3295] [DOCS] Update of documentation
-
[OPIK-3295] [DOCS] Removed conflicting file
-
Optimised images with calibre/image-actions
-
[OPIK-3295] [BE] Update OpenTelemetryMapper to include all imports
- Added imports for
extractTags,extractToJsonColumn, andextractUsageFieldfromOpenTelemetryMappingUtils.
- [OPIK-3295] [BE] Refactor tests with parameterized cases and centralized data sources
- Replaced repetitive test methods with parameterized tests using
@ParameterizedTestand@MethodSource. - Introduced centralized test data generators for invalid JSON strings, usage field values, and tag values.
- Simplified and reduced redundant test logic in
OpenTelemetryMappingUtilsTest.
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
下载附件