Contents

Overview

Helidon SE support for OpenTelemetry configuration and semantic conventions as described below is currently a preview feature. We intend to support it going forward, but we might change its external API and behavior in backward-incompatible ways across dot releases.

Helidon SE supports OpenTelemetry in several important ways:

  • Implements the neutral Helidon tracing API using OpenTelemetry

  • Allows users to assign OpenTelemetry settings as follows:

    • Declaratively, using Helidon config under the top-level telemetry config key

    • Programmatically, using the OpenTelemetry SDK API and the Helidon OpenTelemetry API

  • Conforms to the OpenTelemetry semantic conventions for automatically-created spans and metrics for HTTP requests

  • Allows publishing Helidon metrics to backend systems using OTLP.

OpenTelemetry models observability as a set of signals. Each signal—​for example metrics, tracing, and logging—​is an origin of monitoring data, and each has configurable settings which control its behavior.

Helidon’s config support for OpenTelemetry has certain config attributes which apply to OpenTelemetry as a whole, others which pertain to individual signals, and still more which describe lower-level elements within a signal.

The Helidon OpenTelemetry configuration format, the Helidon OpenTelemetry API, and this documentation all follow this hierarchy:

This document describes how to configure each level in the hierarchy and covers general topics related to Helidon’s support of OpenTelemetry.

API

There are two APIs that might be useful to developers working with OpenTelemetry:

  • The Helidon OpenTelemetry API - useful for mapping configuration sources to Helidon builders and, ultimately, OpenTelemetry objects.

  • The OpenTelemetry API - useful for creating OpenTelemetry objects apart from Helidon configuration sources.

The types in the Helidon OpenTelemetry API correspond closely to the configuration structures described in later sections of this document. Application code can use Helidon OpenTelemetry builders to prepare and construct each of the configurable entities to ultimately prepare an OpenTelemetry instance set up according to the application’s needs.

That said, application code can equally well use the OpenTelemetry API and its builders to prepare the OpenTelemetry instance.

Applications could even use both APIs together, reading configuration to construct a Helidon builder and then adding to that builder OpenTelemetry objects created separately using the OpenTelemetry API.

The Helidon OpenTelemetry API Javadoc page lists the various types developers can use to prepare OpenTelemetry objects programmatically. As a starting point, the OpenTelemetryConfig interface and its Builder represents the top-level configuration for OpenTelemetry. Their Javadoc contains links to other types that compose the top-level object, and so on.

Later sections in this document also describe the configuration settings available.

The OpenTelemetry SDK documentation explains its API.

Note

Many applications do not need to use either the Helidon OpenTelemetry API or the OpenTelemetry API directly. They can instead rely completely on declarative Helidon configuration of OpenTelemetry.

Managing the Global OpenTelemetry Instance

Typically, an application uses the same OpenTelemetry instance throughout its execution. OpenTelemetry offers a global OpenTelemetry instance to make it easy for application code to set and obtain the global instance.

Similarly, the Helidon tracing API has a global Tracer.

In most cases, an application that prepares OpenTelemetry programmatically should initialize both of those by including code as shown in the following example.

Setting the global OpenTelemetry and Tracer instances in Helidon
import java.util.Map;
import io.helidon.telemetry.otelconfig.HelidonOpenTelemetry;

import io.opentelemetry.api.GlobalOpenTelemetry;
import io.opentelemetry.api.OpenTelemetry;
import io.opentelemetry.api.trace.SpanKind;
import io.opentelemetry.api.trace.StatusCode;
import io.opentelemetry.context.Scope;
import io.opentelemetry.sdk.autoconfigure.AutoConfiguredOpenTelemetrySdk;

        // Application code using the OpenTelemetry API or the Helidon OpenTelemetry API or both.
        OpenTelemetry customOpenTelemetry = prepareOpenTelemetry();

        // App code to build any tags to be applied to every span.
        Map<String, String> tags = prepareTags();

        HelidonOpenTelemetry.global(customOpenTelemetry,
                                    "your-service-name",
                                    tags);
Copied

Assigning the Global Instance

Using Helidon to set the global OpenTelemetry instance has these effects:

  • Assigns the instance as the OpenTelemetry global instance.

  • Creates a Helidon Tracer using the OpenTelemetry instance and makes that the Helidon global Tracer.

Helidon is deprecating its use of "global" Helidon objects in favor of retrieving the correct instance from the Helidon service registry. Applications should migrate toward using, for example, Services.get(Tracer.class) instead of Tracer.global().

Maven Coordinates

To enable various aspects of OpenTelemetry Support add one or more of the following dependencies to your project’s pom.xml (see Managing Dependencies).

Using the OpenTelemetry implementation of the Helidon Tracing API

Helidon offers an implementation of its neutral tracing API that uses OpenTelemetry. Add the following dependency to use OpenTelemetry for tracing.

Dependency to use the Helidon OpenTelemetry implementation of Helidon tracing
<dependency>
    <groupId>io.helidon.tracing.providers</groupId>
    <artifactId>helidon-tracing-providers-opentelemetry</artifactId>
    <scope>runtime</scope>
</dependency>
Copied

Adding OpenTelemetry Configuration and Builder Support

To allow deployers and end users to set up Helidon configuration to control OpenTelemetry behavior, add the following dependency.

Dependency to add Helidon OpenTelemetry config and programmatic builder support
<dependency>
    <groupId>io.helidon.telemetry</groupId>
    <artifactId>helidon-telemetry-opentelemetry-config</artifactId>
    <scope>runtime</scope> 
</dependency>
Copied
  • To use the Helidon OpenTelemetry API in your application code, remove this line or change it to <scope>compile</scope>.

Enabling Automatic Spans for HTTP Requests

Helidon’s tracing observability support automatically creates a new tracing span for each HTTP request if your project includes the following dependency.

Dependency for automatic HTTP request tracing
<dependency>
    <groupId>io.helidon.webserver.observe</groupId>
    <artifactId>helidon-webserver-observe-tracing</artifactId>
    <scope>runtime</scope>
</dependency>
Copied

By default, when Helidon SE creates spans automatically for HTTP requests, it uses a set of rules—​semantic conventions—​for choosing the span name and adding tags to each span.

OpenTelemetry prescribes its own semantic conventions. If you add the following dependency, Helidon follows the OpenTelemetry semantic conventions for spans instead of its own.

Dependency for Helidon support of the OpenTelemetry tracing semantic conventions
<dependency>
    <groupId>io.helidon.webserver.observe</groupId>
    <artifactId>helidon-webserver-observe-telemetry-tracing</artifactId>
    <scope>runtime</scope>
</dependency>
Copied

Enabling Automatic Metrics for Incoming HTTP Requests

Helidon’s metrics observability support automatically registers and updates one or more meters (depending on configuration) and updates them accordingly as HTTP requests arrive.

Dependency for automatic HTTP request measurements
<dependency>
    <groupId>io.helidon.webserver.observe</groupId>
    <artifactId>helidon-webserver-observe-metrics</artifactId>
    <scope>runtime</scope>
</dependency>
Copied

OpenTelemetry prescribes its own semantic conventions for metrics—​their names and tha attributes (tags) they have. If you add the following dependency, Helidon registers and updates meters according to the OpenTelemetry metrics semantic conventions.

Dependency for Helidon support of the OpenTelemetry metrics semantic conventions for incoming HTTP requests
<dependency>
  <groupId>io.helidon.webserver.observe</groupId>
  <artifactId>helidon-webserver-observe-telemetry-metrics</artifactId>
  <scope>runtime</scope>
</dependency>
Copied

Enabling OpenTelemetry for Outgoing Helidon Webclient Traffic

Helidon supports the OpenTelemetry semantic conventions for outgoing traffic which uses the Helidon WebClient. See the Helidon WebClient documentation.

Specifying Additional OpenTelemetry Dependencies

Most applications need to declare other runtime dependencies on OpenTelemetry artifacts because the configuration specifies—​or the application code uses—​particular OpenTelemetry types packaged in other artifacts. For example, OpenTelemetry exporters are packaged individually or as related groups. See this section below for some specific dependencies to consider adding for particular exporters.

These exporters transmit telemetry data using a different protocol. (See this OpenTelemetry page.)

Configuration

You can control almost all of OpenTelemetry’s overall, tracing, metrics, and logger runtime behavior using Helidon configuration settings. Helidon constructs an OpenTelemetry object using the configuration. The resulting OpenTelemetry instance reflects these settings from the Helidon configuration:

Controlling Overall OpenTelemetry Behavior

Several settings control the operation of OpenTelemetry as a whole, as shown in the next table.

Configuration options

KeyKindTypeDefault ValueDescription
enabledVALUEBooleantrueWhether the OpenTelemetry support is enabled
globalVALUEBooleantrueWhether the io.opentelemetry.api.OpenTelemetry instance created from this configuration should be made the global one
propagatorsLISTi.h.t.o.O.CustomMethods OpenTelemetry io.opentelemetry.context.propagation.TextMapPropagator instances added explicitly by the app
serviceVALUEString Service name used in sending telemetry data to the collector
signals.loggingVALUEi.h.t.o.OpenTelemetryLoggingConfig OpenTelemetry logging settings
signals.metricsVALUEi.h.t.o.OpenTelemetryMetricsConfig OpenTelemetry metrics settings
signals.tracingVALUEi.h.t.o.OpenTelemetryTracingConfig OpenTelemetry tracing settings

Notes:

  • OpenTelemetry uses default propagators of tracecontext and baggage. (See the otel.propagators property in this OpenTelemetry guide.)

  • Setting global to true has the effect described in the section about global instances.

Common Configuration Across Signals

This section describes settings that apply to multiple signal types.

Assigning Attributes

Configured attributes are key/value pairs that OpenTelemetry attaches to each transmission of a signal. OpenTelemetry supports attributes of type String, long, double, and boolean. The Helidon configuration structure groups attributes by type so Helidon can indicate precisely to OpenTelemetry what type you intend for each attribute.

You can add attributes to the configuration for any of the signals under the signal’s attributes section.

Configuration options
KeyKindTypeDescription
booleansMAPBooleanBoolean attributes
doublesMAPDoubleDouble attributes
longsMAPLongLong attributes
stringsMAPStringString attributes

The following example shows attribute settings for the tracing signal.

Example attribute settings
telemetry:
  service: my-helidon-service
  tracing:
    attributes:
      strings:
        attr1: 12
        attr5: "any old thing"
        attr7: something
      longs:
        attr2: 12
      doubles:
        attr3: 24.5
        attr6: 12
      booleans:
        attr4: true
Copied

Configuring Exporters and Processors/Readers

OpenTelemetry transmits the telemetry data it gathers to a backend system—​such as Grafana, Signoz, Prometheus, Jaeger, or others—​where you can view and query the data. OpenTelemetry goes through these distinct steps to gather and send data:

  1. OpenTelemetry tracing and log record processors and metrics readers gather and process data observations.
  2. OpenTelemetry exporters associated with each processor or reader then transmit_ the data to one or more targets. Targets are typically backend systems but can be local ones for debugging. Each processor or reader uses one or more exporters to transmit telemetry data.

The processor settings determine when and how often each uses its exporters to deliver data. Each exporter’s settings prescribe where it should send the data, how to connect to a backend, etc.

Configuring Processors (and readers)

An OpenTelemetry span or log record processor or metric reader is one of the following types:

  • simple - The processor sends each telemetry observation to its exporters for transmission as soon as it receives the observation.

  • batch - The processor groups observations into batches and sends a batch at a time to its exporters for transmission.

In the table below only the type and exporters setting apply to simple processors; the other settings are for batch processors.

Configuration options
KeyKindTypeDescription
exportersLISTStringName(s) of the exporter(s) this processor should use; specifying no names uses all configured exporters (or if no exporters are configured, the default OpenTelemetry exporter(s))
max-export-batch-sizeVALUEIntegerMaximum number of items batched for export together
max-queue-sizeVALUEIntegerMaximum number of items retained before discarding excess unexported ones
schedule-delayVALUEDurationDelay between consecutive exports
timeoutVALUEDurationMaximum time an export can run before being cancelled
typeVALUEi.h.t.o.ProcessorTypeProcessor type
Configuring Exporters

Exporter objects in OpenTelemetry are specific to both how they transmit telemetry data and what signal they work with. Even so, many exporter settings are very similar across different signals. This section describes the behavior and configuration that is common among exporters. Refer to the sections below that describe each signal to see what additional exporter settings, if any, each signal adds.

Helidon configuration supports several of the most popular exporters, discussed below.

Setting Up OTLP Exporters

Most users choose an Otlp exporter which has two variations—​one using gRPC and one using HTTP with protocol buffers—​as indicated by the protocol setting.

Configuration options
Common Configuration for OTLP exporters
KeyKindTypeDefault ValueDescription
certificateVALUEi.h.c.c.Resource Trusted certificates
client.certificateVALUEi.h.c.c.Resource TLS certificate
client.keyVALUEi.h.c.c.Resource TLS client key
compressionVALUEi.h.t.o.CompressionType Compression the exporter uses
connect-timeoutVALUEDuration Connection timeout
endpointVALUEURI Endpoint of the collector to which the exporter should transmit
headersMAPString Headers added to each export message
internal-telemetry-versionVALUEi.o.s.c.InternalTelemetryVersion Self-monitoring telemetry OpenTelemetry should collect
memory-modeVALUEi.o.s.c.e.MemoryMode Memory mode
protocolVALUEi.h.t.o.O.CustomMethodsDEFAULTExporter protocol type
retry-policyVALUEi.h.t.o.O.CustomMethods Retry policy
timeoutVALUEDuration Exporter timeout
OpenTelemetry OTLP exporter defaults
SettingOpenTelemetry default
compressionnone
endpointgrpc protocol: http://localhost:4317http/proto protocol: http://localhost:4318
protocolgrpc
retry-policynone
timeout10 seconds
OTLP Retry Policy

You can control how each exporter retries if a transmission to a backend fails.

Configuration options
KeyKindTypeDescription
initial-backoffVALUEDurationInitial backoff time
max-attemptsVALUEIntegerMaximum number of retry attempts
max-backoffVALUEDurationMaximum backoff time
max-backoff-multiplierVALUEDoubleMaximum backoff multiplier

OpenTelemetry also supports a Zipkin exporter which it has recently deprecated.

Zipkin Exporter
Configuration options
Configuration for Zipkin exporters
KeyKindTypeDescription
compressionVALUEi.h.t.o.CompressionTypeCompression type
encoderVALUEz.c.SpanBytesEncoderEncoder type
endpointVALUEURICollector endpoint to which this exporter should transmit
timeoutVALUEDurationExporter timeout

The OpenTelemetry documentation describes the defaults; see the "Properties for Zipkin span exporters" section there.

OpenTelemetry defaults for Zipkin exporters
SettingOpenTelemetry default value
compressionnone
encoderJSON_V2
endpointhttp://localhost:9411/api/v2/spans
timeout10 seconds

OpenTelemetry provides other exporters, often used for debugging:

  • console

    Writes telemetry data at the INFO level using the java.util.logging.Logger for io.opentelemetry.exporter.logging.Logging{signal}Expoerter

  • logging-otlp

    Writes telemetry data in JSON format to the logger for the particular OpenTelemetry implementation class (e.g., OtlpJsonLoggingMetricExporter).

The console and logging-otlp have no configuration that is common across all signals.

Note

You need to add dependencies to your project for the exporters your application uses, even ones supported by Helidon config.

The table below describes the exporter types that Helidon configuration supports and what dependency your project needs to support them.

If you need to use an exporter that is not in the table:

  • Add a dependency on the OpenTelemetry artifact that contains that exporter type.

  • Add application code that prepares the exporter instance.

  • Prepare the Helidon OpenTelemetry builders programmatically and add your exporter instance to the builder.

In the table below, the Maven artifacts are all in the io.opentelemetry group.

Exporter typeOpenTelemetry Java TypeArtifact ID to add - seealso the OpenTelemetry documentation
otlp
(see protocol setting below)
OtlpGrpc{signal}Exporter

opentelemetry-exporter-otlp

OtlpHttp{signal}Exporter
zipkinZipkinSpanExporter

opentelemetry-exporter-zipkin

consoleLogging{signal}Exporter

opentelemetry-exporter-logging

logging_otlpOtlpJsonLogging{signal}ExporterSystemOutLogRecordExporeter
Associating Each Processor and Reader with its Exporters

In configuration, you link processors and readers with the exporters you want each to use as follows:

  • For clarity, name each exporter if you have more than one.

  • Optionally specify for each processor or reader the names of the exporters it should use.

    If you omit the exporter names for a processor or reader, Helidon associates it with all configured exporters. If you configure no exporters explicitly, Helidon associates the OpenTelemetry default exporter with the processor or reader.

The following examples show increasingly-complicated scenarios using tracing as the signal:

  • Default

  • Minimal configuration

  • Maximum flexibility

For many applications the default and minimal scenarios work well.

Default

This scenario includes no configuration at all for either processors or exporters.

OpenTelemetry uses its default processor (batch) with its default exporter (otlp using grpc). |

telemetry:
  service: "inventory"
  tracing:
    sampler: "always_off"
Copied
Minimal configuration

The user configures at most one processor and at most one exporter.

The single processor uses the single exporter.

No exporter name is declared or referenced.

telemetry:
  service: "inventory"
  tracing:
    sampler: "always_off"
    exporters:
      - type: zipkin
        compression: gzip
    processors:
      - type: batch
        max-queue-size: 50
Copied
Maximum flexibility

The user configures possibly multiple processors and possibly multiple named exporters. Each processor’s configuration lists the names of the exporters it should use; no names means all exporters.

The first processor (type batch) uses both exporters because it does not specify any exporter names. The second processor uses only the alternate-otlp exporter.|

telemetry:
  service: "inventory"
  tracing:
    sampler: "always_off"
    exporters:
      - type: zipkin
        compression: gzip
        name: "compressed-zipkin"
      - endpoint: "http://collect.com:4317"
        name: "alternate-otlp""
    processors:
      - type: batch
        max-queue-size: 50
      - type: simple
        exporters: ["alternate-otlp"]
Copied

Controlling OpenTelemetry Tracing Behavior

The settings under signals.tracing prepare an OpenTelemetry TracerProvider. When your application uses the Helidon tracing API to obtain a Tracer, Helidon uses the TracerProvider prepared from this config to create the tracer.

The next table describes the OpenTelemetry tracing settings.

Configuration options

KeyKindTypeDescription
attributesVALUEi.h.t.o.O.CustomMethodsName/value pairs passed to OpenTelemetry
exportersMAPi.h.t.o.O.CustomMethodsSpan exporters
processorsLISTi.h.t.o.O.CustomMethodsSettings for span processors
samplerVALUEi.h.t.o.O.CustomMethodsTracing sampler
span-limitsVALUEi.h.t.o.O.CustomMethodsTracing span limits

OpenTelemetry applies the defaults described in the next table.

Default tracing settings applied by OpenTelemetry
SettingOpenTelemetry default (and OpenTelemetry doc link)
exportersotlp with grpc protocol - see "Properties: exporters, otel.traces.exporter property"
processorsbatch with defaults - see "Properties for batch span processor(s)"
samplerparentbased_always_on - see "Properties for sampler"
span-limitsSee tracing "Properties for span limits"

Refer to the earlier sections about configuring attributes and configuring processors and exporters.

Sections below describe how to set up the tracing signal configuration:

Configuring the Span Sampler

OpenTelemetry offers different ways of sampling data—​deciding which tracing spans tp capture and send to the backend. The OpenTelemetry documentation describes sampling in more detail.

Helidon configuration supports the sampler implementations that reside in the opentelemetry-sdk as listed in the table below. Other samplers are in other components. If you need to use one of those:

  • Add the relevant OpenTelemetry dependency to your project.

  • Instantiate the span sample you need.

  • Prepare the sampler and the OpenTelemetry-related builders programmatically and use your sampler to assign the sampler the OpenTelemetryTracer.Builder should use.

Configuration options

KeyKindTypeDefault ValueDescription
paramVALUEDouble Sampler parameter
typeVALUEi.h.t.o.SamplerTypeDEFAULTSampler type

Configuring Span Limits

OpenTelemetry allows you to constrain certain aspects of the data it gathers in tracing spans. By assigning the settings in the table below, you can apply the span limits you want.

Configuration options

KeyKindTypeDescription
max-attribute-value-lengthVALUEIntegerMaximum attribute value length
max-attributesVALUEIntegerMaximum number of attributes
max-attributes-per-eventVALUEIntegerMaximum number of attributes per event
max-attributes-per-linkVALUEIntegerMaximum number of attributes per link
max-eventsVALUEIntegerMaximum number of events
max-linksVALUEIntegerMaximum number of links

The OpenTelemetry documentation describes the defaults; see the "Properties for span limits" section there.

OpenTelemetry defaults for span limits
SettingOpenTelemetry Default
max-attribute-value-lengthno limit
max-attributes128
max-attributes-per-event128
max-events128
max-links128

Controlling OpenTelemetry Metrics Behavior

The settings under signals.metrics prepare an OpenTelemetry MeterProvider. If your code uses the OpenTelemetry API to obtain an OpenTelemetry meter, meter provider, or meter builder, OpenTelemetry uses the MeterProvider prepared from this configuration.

The sections below describe Helidon config settings that correspond very directly to OpenTelemetry builders for the relevant OpenTelemetry type. Refer to the relevant OpenTelemetry documentation or Javadoc to understand the effect each setting has.

See the earlier sections about configuring attributes and configuring processors and exporters. A later section below describes some additional attributes on metrics exporters.

The next table describes the OpenTelemetry metrics settings.

Configuration options

KeyKindTypeDescription
attributesVALUEi.h.t.o.O.CustomMethodsName/value pairs passed to OpenTelemetry
exportersMAPi.h.t.o.O.CustomMethodsMetric exporter configurations, configurable using io.helidon.telemetry.otelconfig.MetricExporterConfig
readersLISTi.h.t.o.O.CustomMethodsSettings for metric readers
viewsLISTi.h.t.o.O.CustomMethodsMetric view information, configurable using io.helidon.telemetry.otelconfig.ViewRegistrationConfig

OpenTelemetry applies the defaults described in the next table.

Default metric settings applied by OpenTelemetry
SettingOpenTelemetry default (and OpenTelemetry doc link)
exportersotlp with grpc protocol - see that web page’s "Properties: exporters, otel.metrics.exporter property"] section.
readersPeriodicMetricReader with an interval of one minute

Sections below describe how to set up the configuration that is specific to the metrics signal:

The following example illustrates some of the ways you can configure OpenTelemetry metrics behavior. It is neither complete nor typical.

Example OpenTelemetry Metrics Configuration
telemetry:
  service: "test-telemetry"
  signals:
    metrics:                                          
      exporters:
        - name: exp-1                                 
          type: otlp
          endpoint: "http://host:1234"
          temporality-preference: cumulative          
          default-histogram-aggregation:              
            type: base2-exponential-bucket-histogram
            max-buckets: 152
            max-scale: 19
        - name: exp-2                                 
          type: otlp
          protocol: grpc
          temporality-preference: delta               
          default-histogram-aggregation:              
            type: explicit-bucket-histogram
            bucket-boundaries: [3,5,7]
      readers:
        - type: periodic                              
          exporter: exp-1
          interval: PT6S
      views:
        - name: sum-view                              
          aggregation:
            type: sum
          description: "Sum view"
          instrument-selector:
            name: counter-selector
            type: counter
            meter-name: my-counter
Copied
  • Introduces the metrics configuration.
  • Introduces the first metric exporter (with name exp-1).
  • Indicates to accumulate measurement values since the previous transmission.
  • Prescribes to aggregate histograms for transmission using the OpenTelemetry BASE2_EXPONENTIAL_BUCKET_HISTOGRAM technique with the specified maximum number of buckets and maximum scale.
  • Introduces the second metric exporter (with name exp-2).
  • Indicates to transmit deltas since the last transmission.
  • Prescribes to aggregate histograms using a histogram with the given explicit bucket boundary values.
  • Declares a single metric reader of the OpenTelemetry PERIODIC types gathering data each 6 seconds.
  • Declares a single view to influence influence the transmission of the my-counter counter data.

Metric Exporters

The configuration for metrics exporters has several additional settings beyond those described earlier for exporters in general.

Configuration options

KeyKindTypeDefault ValueDescription
certificateVALUEi.h.c.c.Resource Trusted certificates
client.certificateVALUEi.h.c.c.Resource TLS certificate
client.keyVALUEi.h.c.c.Resource TLS client key
compressionVALUEi.h.t.o.CompressionType Compression the exporter uses
connect-timeoutVALUEDuration Connection timeout
default-histogram-aggregationVALUEi.h.t.o.M.CustomMethods Preferred default histogram aggregation technique, configurable as io.helidon.telemetry.otelconfig.MetricDefaultHistogramAggregationConfig
endpointVALUEURI Endpoint of the collector to which the exporter should transmit
headersMAPString Headers added to each export message
internal-telemetry-versionVALUEi.o.s.c.InternalTelemetryVersion Self-monitoring telemetry OpenTelemetry should collect
memory-modeVALUEi.o.s.c.e.MemoryMode Memory mode
protocolVALUEi.h.t.o.O.CustomMethodsDEFAULTExporter protocol type
retry-policyVALUEi.h.t.o.O.CustomMethods Retry policy
temporality-preferenceVALUEi.h.t.o.M.CustomMethods Preferred output aggregation technique (how transmitted values reflect the values recorded locally), configurable as a io.helidon.telemetry.otelconfig.MetricTemporalityPreferenceType value: CUMULATIVE, DELTA, LOWMEMORY
timeoutVALUEDuration Exporter timeout
typeVALUEi.h.t.o.MetricExporterTypeOTLPMetric exporter type
Metric Aggregation

OpenTelemetry allows control over how each exporter aggregates histogram data prior to transmission to a backend.

Configuration options

KeyKindTypeDescription
typeVALUEi.h.t.o.MetricDefaultHistogramAggregationTypeType of aggregation default

You can configure the explicit bucket boundaries for EXPLICIT_BUCKET_HISTOGRAM aggregation.

Configuration options

KeyKindTypeDescription
bucket-boundariesLISTDoubleExplicit bucket boundaries

You can configure the exponential histogram aggregation behavior.

Configuration options

KeyKindTypeDescription
max-bucketsVALUEIntegerMaximum number of buckets
max-scaleVALUEIntegerMaximum scale

Metric Readers

An OpenTelemetry metric reader collects metric data in the server and then uses the associated metric exporter to send that data to the endpoint configured.

Configuration options

KeyKindTypeDefault ValueDescription
exporterVALUEString Name of the configured metric exporter to use for this metric reader
typeVALUEi.h.t.o.MetricReaderTypePERIODICMetric reader type

The periodic reader supports the following settings.

Configuration options

KeyKindTypeDefault ValueDescription
exporterVALUEString Name of the configured metric exporter to use for this metric reader
intervalVALUEDuration Metric reader read interval
typeVALUEi.h.t.o.MetricReaderTypePERIODICMetric reader type

Metric Views

OpenTelemetry metric views allow you to influence how meters are aggregated for reporting to backend systems.

Configuration options

KeyKindTypeDescription
aggregationVALUEi.h.t.o.V.CustomMethodsAggregation for the metric view, configurable as an io.helidon.telemetry.otelconfig.AggregationType: DROP, DEFAULT, SUM, LAST_VALUE, EXPLICIT_BUCKET_HISTOGRAM, BASE2_EXPONENTIAL_BUCKET_HISTOGRAM
attribute-filterVALUEi.h.t.o.V.CustomMethodsAttribute name filter, configurable as a string compiled as a regular expression using java.util.regex.Pattern
cardinality-limitVALUEIntegerCardinality limit
descriptionVALUEStringMetric view description
instrument-selectorVALUEi.h.t.o.V.CustomMethodsInstrument selector, configurable using io.helidon.telemetry.otelconfig.InstrumentSelectorConfig
nameVALUEStringMetrics view name

The instrument selector controls which meters this view reflects.

Configuration options

KeyKindTypeDescription
meter-nameVALUEStringMeter name
meter-schema-urlVALUEStringMeter schema URL
meter-versionVALUEStringMeter version
nameVALUEStringInstrument name
typeVALUEi.o.s.m.InstrumentTypeInstrument type
unitVALUEStringInstrument unit

Controlling OpenTelemetry Logger Behavior

The settings under signal.logging prepare an OpenTelemetry `LoggerProvider.

The sections below describe Helidon config settings that correspond directly to OpenTelemetry builders for the relevant OpenTelemetry type. Refer to the relevant OpenTelemetry documentation or Javadoc to understand the effect each setting has.

The next table describes the OpenTelemetry logging settings.

Configuration options

KeyKindTypeDescription
attributesVALUEi.h.t.o.O.CustomMethodsName/value pairs passed to OpenTelemetry
enabledVALUEBooleanWhether the OpenTelemetry logger should be enabled
exportersMAPi.h.t.o.O.CustomMethodsLog record exporters
log-limitsVALUEi.h.t.o.O.CustomMethodsLog limits to apply to log transmission
minimum-severityVALUEi.o.a.l.SeverityMinimum severity level of log records to process
processorsLISTi.h.t.o.O.CustomMethodsSettings for logging processors
trace-basedVALUEBooleanWhether to include only log records from traces which are sampled

OpenTelemetry uses the following defaults:

Default logging settings applied by OpenTelemetry
SettingOpenTelemetry default
exportersnone
minimum-severityundefined severity number
processorsno-op processor
trace-basedfalse

Refer to the earlier sections about configuring attributes and configuring processors and exporters.

Sections below explain how to set up the configuration that is specific to the logging signal:

Configuring Log Limits

For defaults, Helidon defers to the OpenTelemetry defaults, listed below.

Configuration options
KeyKindTypeDescription
max-attribute-value-lengthVALUEIntegerMaximum length of an attribute value
max-number-of-attributesVALUEIntegerMaximum number of attributes allowed

OpenTelemetry applies the following defaults:

Default log limit settings applied by OpenTelemetry
SettingOpenTelemetry default
max-attribute-value-lengthInteger.MAX_VALUE
max-number-of-attributes128
exportersotlp with grpc protocol - see that web page’s "Properties: exporters, otel.logger.exporter property" section.
log-limits`max-
processorsotlp - see that web page’s "Properties: logs" section.

The following example illustrates some of the ways you can configure OpenTelemetry logger behavior. It is neither complete nor typical.

Example OpenTelemetry Logger Configuration
telemetry:
  service: test-tel-logging
  global: false
  signals:
    logging:                              
      minimum-severity: TRACE             
      log-limits:                         
        max-attribute-value-length: 20
        max-number-of-attributes: 14
      processors:                         
        - type: batch
          schedule-delay: PT10S
          max-queue-size: 15
          max-export-batch-size: 5
          timeout: PT30S
        - type: simple
      exporters:                          
        - name: exp-1
          endpoint: "http://host:1234"
Copied
  • Introduces the logger configuration.
  • Sets the minimum log level severity to of log messages to send to the backend system.
  • Configures limits related to attributes that accompany log messages.
  • Prescribes the logger processors.
  • Prescribes the logger exporters.

Logger Exporters and Processors

You associate each logger processor with a logger exporter using the exporter’s name. See the earlier section for more information.

Additional Information