opik icon indicating copy to clipboard operation
opik copied to clipboard

[Bug]: Spring AI (Java) integration docs reference a non-existent dependency; OTEL tags/metadata not recognized with workaround

Open ptaillard opened this issue 1 month ago • 2 comments

What component(s) are affected?

  • [ ] Opik Python SDK
  • [ ] Opik Typescript SDK
  • [ ] Opik Agent Optimizer SDK
  • [x] Opik UI
  • [ ] Opik Server
  • [x] Documentation

Opik version

  • Opik hosted version: latest

Describe the problem

Description:

Following the documentation for the Spring AI (Java) integration does not work because the referenced dependency no longer exists on Maven Central. Only versions 1.0.0-M6 and 1.0.0-M5 are available. Docs: https://www.comet.com/docs/opik/integrations/spring-ai As a workaround, I managed to send OpenTelemetry data to Opik, but tags and metadata are not recognized by Opik.

Why this matters:

It would be very helpful for Opik and its (future) users to update the Spring AI integration to align with the latest Spring and OpenTelemetry versions so the integration is easy, functional, and supports tags/metadata. It would also be valuable to allow sending additional information in traces via a custom configuration. For example, the ability to attach a custom tag (e.g., our product’s end-user name or other custom attributes) to all traces/spans sent to Opik through the Spring AI integration.

Expected behavior:

The dependency specified in the docs should resolve from Maven Central. Out-of-the-box compatibility with current Spring/Spring Boot and OpenTelemetry. Tags/metadata sent via OTEL span attributes and resource attributes should be recognized by Opik. A simple configuration mechanism to add custom tags/attributes to all traces/spans.

Actual behavior:

The dependency in the docs cannot be resolved; only 1.0.0-M6 and 1.0.0-M5 are available. When sending OTEL data via a workaround, tags/metadata are not recognized.

Reproduction steps and code snippets

Steps to reproduce:

Follow the Spring AI integration guide linked above. Attempt to add the dependency and build the project. Alternatively, send OTEL spans to Opik and observe that tags/metadata are not recognized.

Suggested improvements:

Update the Spring AI integration dependency coordinates and versions in the docs. Release a version compatible with the latest Spring/Spring Boot and OpenTelemetry. Document how Opik maps OTEL resource attributes and span attributes to Opik tags/metadata. Provide a configuration option to add custom attributes to all spans (e.g., global tags such as user identifiers or other domain-specific fields).

Additional context:

If needed, I can share the exact dependency coordinates I tried and sample spans showing which attributes weren’t recognized.

Error logs or stack trace

No response

Healthcheck results

No response

ptaillard avatar Nov 26 '25 09:11 ptaillard

Hi @ptaillard , were taking a look thanks for reporting

Nimrod007 avatar Nov 26 '25 12:11 Nimrod007

Hi @ptaillard ! We are already working on the requested changes. In the meantime, you can check out the OPIK + SpringAI integration demo project. It demonstrates how to use the latest SpringAI library and how to set tags and metadata for logged spans. The OPIK backend components responsible for full tag and metadata processing are in the final stages of development, but you can still try out the project now.

I’ll keep you updated once the OPIK backend work is completed.

Cheers, Iaroslav

yaricom avatar Nov 30 '25 18:11 yaricom

Hi @ptaillard ! I’m glad to share that the OPIK backend updates enhancing integration with SpringAI via the OpenTelemetry endpoint have been merged into the main branch and will be released soon.

Meantime you can take a look at the updated documentation page and SpringAI integration demo project.

Cheers, Iaroslav

yaricom avatar Dec 04 '25 18:12 yaricom

Hi @yaricom,

Thanks a lot for your updates! I really appreciate and will integrate it asap it will be released. I'm looking at your doc and example too. Thanks again for your help! Cheers, Pierre

ptaillard avatar Dec 05 '25 07:12 ptaillard

Hi @ptaillard ! The OPIK backend implementing enhanced integration with SpringAI is already released.

Happy coding! Iarolsav

yaricom avatar Dec 09 '25 14:12 yaricom

Hi @yaricom ,

Thanks a lot, and really exciting to test this asap! Cheers

ptaillard avatar Dec 09 '25 14:12 ptaillard