GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Make the exporter sender a public SPI · Issue #6718 · open-telemetry/opentelemetry-java

Make the exporter sender a public SPI #6718

New issue
Copy link
New issue
Copy link
Closed
#7782
Closed
Make the exporter sender a public SPI#6718
#7782
Copy link
Labels
Feature RequestSuggest an idea for this project

Description

@brunobat
brunobat
opened on Sep 12, 2024
Issue body actions

Right now we have the exporter sender SPI under private folders:
https://github.com/open-telemetry/opentelemetry-java/blob/main/exporters/common/src/main/java/io/opentelemetry/exporter/internal/grpc/
And
https://github.com/open-telemetry/opentelemetry-java/blob/main/exporters/common/src/main/java/io/opentelemetry/exporter/internal/http/

We should allow frameworks to create their own senders and use an official SPI for it.

Describe the solution you'd like
Publicly support the SPI, classes and interfaces under the above packages.

Additional context
There are many sender implementations already. One example is Quarkus, which has implemented a Vert.x client based sender.
Wildfly will use it as well and other application servers will also have the same need.

Reacted by Georgios Andrianakis, Michal Vavřík and Sébastien Crocquesel

Activity

  1. brunobat
    added
    Feature RequestSuggest an idea for this project
    on Sep 12, 2024
  2. jasondlee commented on Sep 12, 2024

    @jasondlee
    jasondlee
    on Sep 12, 2024
    More actions

    This would be super helpful.

  3. jack-berg commented on Sep 12, 2024

    @jack-berg
    jack-berg
    on Sep 12, 2024
    Member
    More actions

    I'm not comfortable making these SPIs stable for a couple reasons:

    1. The API for HttpSender, GrpcSender continue to churn. I'm not confident that we've reached the correct API contract and want to preserve the ability to making breaking changes. This is only possible while the SPIs are kept as an internal implementation detail.
    2. I don't want to support OtlpHttp{Signal}Exporter, OtlpGrpc{Signal}Exporter based on HttpSender, GrpcSenders which are not published by this project. We have limited resource capacity in this project and already maintain 2 HttpSender and 2 GrpcSender implementations. An ecosystem where is possible / popular to bring-your-own sender adds more support burden and complexity since its likely that users won't understand this subtlety and will open issues in this repo.
    3. I don't understand when the built-in senders are insufficient given that there's a zero-dependency java HttpClient based implementation of HttpSender for Java 11+. Users would have to be stuck on java 8 AND be unable to use OkHttp or any of the grpc upstream transports.
    Reacted by John Watson
  4. brunobat commented on Sep 13, 2024

    @brunobat
    brunobat
    on Sep 13, 2024
    ContributorAuthor
    More actions

    Thanks fort the reply, Jack.

    1. Are there any concrete plans to change this API in any way or is this just an hypothesis?
    2. If HttpSender, GrpcSenders are not published by this project, you don't have to support them. Have you received any questions about the Vert.x based senders?
    3. They are insufficient because OkHttp depends on Kotlin, which is a hard stop for most integrators and the JDK HTTP Client is too simplistic. All frameworks have their own optimised clients of choice.
  5. geoand commented on Sep 13, 2024

    @geoand
    geoand
    on Sep 13, 2024
    More actions

    I don't understand when the built-in senders are insufficient given that there's a zero-dependency java HttpClient based implementation of HttpSender for Java 11+. Users would have to be stuck on java 8 AND be unable to use OkHttp or any of the grpc upstream transports.

    As the person who wrote the Vert.x senders for Quarkus, I can chime in on this: As Bruno said we did not want OkHttp anywhere on our classpath because it has a dependency on Kotlin.
    The reason we chose Vert.x instead of some other stack, is because we want our observability stack to have as low overhead as possible on the application. In this specific case, overhead can creep in by loading tons of extra classes (which would otherwise never be loaded) and management of client specific thread pools.

  6. jack-berg commented on Sep 13, 2024

    @jack-berg
    jack-berg
    on Sep 13, 2024
    Member
    More actions

    Are there any concrete plans to change this API in any way or is this just an hypothesis?

    Check out the history in the sender / providers:

    • https://github.com/open-telemetry/opentelemetry-java/commits/main/exporters/common/src/main/java/io/opentelemetry/exporter/internal/grpc/GrpcSenderProvider.java
    • https://github.com/open-telemetry/opentelemetry-java/commits/main/exporters/common/src/main/java/io/opentelemetry/exporter/internal/grpc/GrpcSender.java
    • HttpSenderProvider
    • https://github.com/open-telemetry/opentelemetry-java/commits/main/exporters/common/src/main/java/io/opentelemetry/exporter/internal/http/HttpSender.java

    The churn in the APIs is very real, and could continue to change with additional enhancements for things like authentication providers, retry configurability, and whatever other features users request.

    If HttpSender, GrpcSenders are not published by this project, you don't have to support them. Have you received any questions about the Vert.x based senders?

    Users won't know the difference. Can't say whether or not the things we've supported are based on Vert.x senders.

    They are insufficient because OkHttp depends on Kotlin, which is a hard stop for most integrators and the JDK HTTP Client is too simplistic. All frameworks have their own optimised clients of choice.

    "too simplistic" - not a convincing argument for an implementation detail. You can always implement your own SpanExporter, MetricExporter, LogRecordExporter from the ground up. After all, OTLP is a generic protocol and there's no reason that all implementations in java have to be based on the same stack of tooling.

    The reason we chose Vert.x instead of some other stack, is because we want our observability stack to have as low overhead as possible on the application. In this specific case, overhead can creep in by loading tons of extra classes (which would otherwise never be loaded) and management of client specific thread pools.

    Why not use the built-in JDK HTTP sender? No extra classes required and it appears quarkus already requries java 11 (or 17).

  7. brunobat commented on Sep 13, 2024

    @brunobat
    brunobat
    on Sep 13, 2024
    ContributorAuthor
    More actions

    The JDK HTTP client has many drawbacks for our case, here are a few:

    • It's inefficient for high throughput loads unlike the reactive Vert.x HTTP client. Requires many additional threads on those cases.
    • We would need to include the JDK HTTP client related classes in the builds, just for this, increasing the footprint. Classes that are not used are excluded by the Quarkus build.
    • We would need to add additional integrations for that client like certificate, thread, fault tolerance management, and others. All this is already implemented and battle tested for the Vert.x HTTP client.
    • We do use GRPC (still default on Quarkus) and HTTP protocols. Doing the 1st with that client is not possible.
    Reacted by Georgios Andrianakis, Roberto Cortez and Michal Vavřík
  8. geoand commented on Sep 13, 2024

    @geoand
    geoand
    on Sep 13, 2024
    More actions

    No extra classes required and it appears quarkus already requries java 11 (or 17).

    Sure, but those are never loaded. And the thread pool issue still remain

  9. trask commented on Sep 13, 2024

    @trask
    trask
    on Sep 13, 2024
    Member
    More actions

    the thread pool issue still remain

    OpenTelemetry exporters are batched and single-threaded, can you elaborate on what kind of thread pool issue you are seeing?

  10. geoand commented on Sep 14, 2024

    @geoand
    geoand
    on Sep 14, 2024
    More actions

    The JDK client manages its own Thread Pool and that inevitably leads to some overhead

  11. jack-berg commented on Sep 23, 2024

    @jack-berg
    jack-berg
    on Sep 23, 2024
    Member
    More actions

    The JDK client manages its own Thread Pool and that inevitably leads to some overhead

    JdkHttpSender only sends synchronous requests (i.e. it never calls sendAsync(..)). I assume this means that the calling thread is used to perform the work and no thread pool is created / used. The executor used to execute async requests is configurable, and it looks like if its not configured Executors.newCachedThreadPool(ThreadFactory) is used. I believe this will only create threads if needed, which should be never since we don't use any async methods.

  12. brunobat commented on Oct 15, 2025

    @brunobat
    brunobat
    on Oct 15, 2025
    ContributorAuthor
    More actions

    @trask @jack-berg I would appreciate some if this issue is revisited. This is causing us problems.

  13. brunobat commented on Oct 15, 2025

    @brunobat
    brunobat
    on Oct 15, 2025
    ContributorAuthor
    More actions

    Just an example of what I'm talking about: During the work of the exporter metrics this class was created and the costructor made package friendly:

    opentelemetry-java/sdk/common/src/main/java/io/opentelemetry/sdk/internal/StandardComponentId.java

    Line 54 in 056837a

    StandardComponentId(ExporterType standardType) {

    This prevents anyone outside the SDK to create a sender.
    CC @JonasKunz

  14. jack-berg commented on Oct 15, 2025

    @jack-berg
    jack-berg
    on Oct 15, 2025
    Member
    More actions

    I am planning on working on this soon-ish.

    Reacted by Bruno Baptista and Michal Vavřík
  15. jack-berg
    closed this as completedin #7782on Jan 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Feature RequestSuggest an idea for this project

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.