Interface TracerProvider

All Known Implementing Classes:
OpenTelemetryTracerProvider

public interface TracerProvider
Java service to integrate various distributed tracers. The first tracer configured will be used.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Whether there is a tracer available by this provider.
    Create a new builder for this tracer.
    Provide current span.
    default Tracer
    Deprecated, for removal: This API element is subject to removal in a future version.
    use Services.get(Class) to obtain the application-wide Tracer from the service registry
    default void
    global(Tracer tracer)
    Deprecated, for removal: This API element is subject to removal in a future version.
    use Services.set(Class, Object[]) to register a Tracer in the service registry before tracing is requested
  • Method Details

    • createBuilder

      TracerBuilder<?> createBuilder()
      Create a new builder for this tracer.
      Returns:
      a tracer builder
    • global

      @Deprecated(forRemoval=true, since="27.0.0") default Tracer global()
      Deprecated, for removal: This API element is subject to removal in a future version.
      use Services.get(Class) to obtain the application-wide Tracer from the service registry
      Legacy global tracer access. This method will be removed in a future major version, remove an Override annotation from it to be "future proof".
      Returns:
      never returns
      Throws:
      UnsupportedOperationException - always
    • global

      @Deprecated(forRemoval=true, since="27.0.0") default void global(Tracer tracer)
      Deprecated, for removal: This API element is subject to removal in a future version.
      use Services.set(Class, Object[]) to register a Tracer in the service registry before tracing is requested
      Legacy global tracer assignment.

      Helidon 27 uses the service registry for application-wide tracer instances. This method is retained only for compatibility with provider implementations compiled against earlier versions. It is expected to be a no-op and will be removed in a future version.

      Parameters:
      tracer - ignored
      Throws:
      NullPointerException - if tracer is null
    • currentSpan

      Optional<Span> currentSpan()
      Provide current span.
      Returns:
      current span, or empty optional if current span cannot be found
    • available

      boolean available()
      Whether there is a tracer available by this provider. This allows co-existence of multiple tracing providers within the same VM.
      Returns:
      whether this tracer provider has a tracer available