Skip to content

Conversation

@jannikmaierhoefer
Copy link

This PR adds a section that shows how to send Spring AI traces to an OpenTelemetry backend such as Langfuse.

@dev-jonghoonpark
Copy link
Contributor

🙌 Please fix the DCO check by signing your commit. git commit --amend --signoff

This PR adds a part to the observability docs page that shows how to send Spring AI traces to an OpenTelemetry backend such as Langfuse.

Signed-off-by: Jannik Maierhöfer <[email protected]>
@jannikmaierhoefer jannikmaierhoefer force-pushed the add-to-observability-page branch from d3b88db to 28055b9 Compare April 3, 2025 12:02
@jannikmaierhoefer
Copy link
Author

Thanks @dev-jonghoonpark :) Just signed off the commit!

@jannikmaierhoefer
Copy link
Author

Hi @dev-jonghoonpark what do you think about this addition? Let me know if there is anything I can add/edit :)

@dev-jonghoonpark
Copy link
Contributor

Sorry for the late reply. @jannikmaierhoefer

I think it's a good guide.

It inspired me with a couple of ideas that might help in the future:

  • Creating a separate document as a sub-item for better organization.
  • Developing a module for easier setup.

But unfortunately, I don't have the authority to approve PRs.
I am just one of the contributors and not a member.😭

@jannikmaierhoefer
Copy link
Author

Thanks @dev-jonghoonpark! @tzolov what do you think about this addition?

@ThomasVitale
Copy link
Contributor

Thanks so much for your contribution! I think it's great to show the integration with Langfuse! I would suggest perhaps to create a dedicated page under the Observability section to showcase the different integrations (starting with a Langfuse page). What do you think?

About the example, I'm afraid the combination of dependencies in the docs is not supported in Spring Boot. It's combining the usage of the OpenTelemetry support in Spring Boot/Micrometer with the OpenTelemetry Spring Boot Starter from the OpenTelemetry Java Instrumentation. They are two mutually exclusive approaches, and I'm not sure about having them both in the same application, since they work in a very different way. Since the Spring AI instrumentation is provided via Micrometer, would it be possible to describe the scenario with that approach (without the OpenTelemetry Spring Boot Starter)?

Besides the project specific instrumentation, Spring AI fully relies on the observability backbone in Spring Boot. Maybe we should point to the Spring Boot documentation about exporting OpenTelemetry traces from a Spring Boot app? There might be differences between Spring Boot versions, so having the docs there might help identifying the right approach based on the used Spring Boot version. Perhaps @jonatan-ivanov has some suggestions.

@jonatan-ivanov
Copy link
Member

jonatan-ivanov commented Apr 22, 2025

My two cents: I don't think we should do this for every single backend that the Observation API supports or can support. The PR feels like advertising to me. As @ThomasVitale mentioned above, this is not the recommended approach (I have doubts that it works).

I think the Spring AI docs could be enhanced by linking to the Boot and Micrometer docs but I don't think it should duplicate them and list every single backend that Boot/Micrometer supports.

@markpollack
Copy link
Member

Thanks for the contribution. I agree that Spring AI isn't the spot for this information.

Please open up an issue or PR on the Spring Boot github repo so using open telemetry with any Spring Boot app (not just Spring AI) so that the entire Spring ecosystem can benefit form this. There already is some docs on this but it seems like they can be improved.

If you would like to create an example specific to Spring AI, you can submit a request to create a repository on the Spring AI Community - https://github.com/spring-ai-community/community/issues All you need is an existing repo of working code that people can run. This would require using infra that everyone can spin up via docker or other infrastructure setup tools.

@markpollack markpollack closed this May 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants