Skip to content

Feature: Spring Boot AutoConfiguration for Pyroscope OTel Integration #86

Description

@fraenkelc

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. 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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions