grafana / grafana/otel-profiling-java
Feature: Spring Boot AutoConfiguration for Pyroscope OTel Integration
- Dominant language
- Go
- Stars
- 53
- Forks
- 10
- Avg merge
- 4d 9h
- Merged PRs (30d)
- 4
Description
### Context
With the recent extraction of `PyroscopeOtelSpanProcessor` to the `lib/` module (PR #9), it's now straightforward to support the **library-based integration** in Spring Boot projects using `spring-boot-starter-opentelemetry`, which is the spring boot approach for sending metrics, traces and logs to opentelemetry endpoints.
### Problem
Currently, Spring Boot applications using `spring-boot-starter-opentelemetry` don't have first-class integration with Pyroscope. Users must manually wire the `PyroscopeOtelSpanProcessor` bean.
### Solution
A new Spring Boot AutoConfiguration starter that:
- Conditionally registers `PyroscopeOtelSpanProcessor` as a bean when `io.opentelemetry.sdk.trace.SpanProcessor`, `io.otel.pyroscope.PyroscopeOtelSpanProcessor`, and `io.pyroscope.javaagent.PyroscopeAgent` are on the classpath
- Optionally starts the Pyroscope agent if not already running
- Provides Spring configuration properties (`otel.pyroscope.*`)
I've successfully tested this approach in a [reference implementation](https://github.com/fraenkelc/otel-pyroscope-spring-boot/blob/main/otel-pyroscope-spring-boot-starter/src/main/java/io/github/fraenkelc/pyroscope/autoconfigure/PyroscopeOtelAutoConfiguration.java). The integration works seamlessly with minimal setup.
### Proposed Contribution
I'd like to contribute this as a new `otel-spring-boot-starter/` submodule (similar to how `lib/` and `otel-extension/` are organized). Would you be open for such a contribution?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.