Lightstep accepts metrics in the OpenTelemetry Protocol (OTLP). This protocol was designed as a format to support both StatsD and Prometheus style metrics exposition for reporting to backend systems. OpenTelemetry distinguishes between these differing formats by introducing a concept of ‘aggregation temporality’; This can be a delta (statsd-like), or cumulative (prometheus-like).

Delta temporality means that the aggregator reports the change in a value since the last time of report, and cumulative temporality means that the aggregator reports the cumulative change in a value since a fixed starting time.

OTLP supports three distinct point types: Sums, Gauges, and Histograms. All of these data points can be expressed as integers or floating point measurements. Sums can use either temporality, and can be monotonic (always increasing) or not; Histograms can also use either temporality. Lightstep fully supports this protocol.

Accepted Service Endpoints and Authentication

The OpenTelemetry Metrics Protocol documents the expected receiver method for exporting metrics, which is fully supported by Lightstep. gRPC and HTTP transport is available, with the appropriate application/x-protobuf or application/json content type. We suggest gRPC or HTTP with application/x-protobuf for metrics exposition to Lightstep at this time.

All authentication occurs using the same token for metrics as it does for tracing, regardless of protocol used. The Lightstep-Access-Token header should be set to your project access token.

For the appropriate endpoint to send metric traffic to, please consult the following table –

Transport Content-Type Endpoint
gRPC protobuf ingest.lightstep.com:443
HTTP application/x-protobuf https://ingest.lightstep.com/metrics/otlp/v0.5
HTTP application/json https://ingest.lightstep.com/metrics/otlp/v0.5

Note - For explicit versions of OTLP over HTTP, please change the route suffix to the appropriate version (i.e., /v0.7)

OpenTelemetry Protocol Details

Every export contains a series of Metric time series data, each containing one or more data points, wrapped by the InstrumentationLibrary and Resource objects. InstrumentationLibrary contains a description of which library generated the metric points, and Resource describes the process which produced the metric points. Lightstep does not record nor use the InstrumentationLibrary field at this time. Resource fields are translated into labels where appropriate (such as service.name, service.version, etc.)

Please note that OTLP contains repeated fields on multiple levels of the protocol to support aggregation early in the data ingestion path. We suggest grouping metric points by Resource and Metric, then making use of the repeated fields inside those objects to send multiple points in a compressed manner.

Request Size and Compression

Requests are limited to 4mb of compressed data. For gRPC, use snappy compression. For HTTP, use gzip. For writes larger than that, chunk into batches of around 64KB (uncompressed) for best performance.

Translating Custom Metrics Pipelines

At this time, we suggest creating a custom OTLP exporter in lieu of using the OpenTelemetry SDK to send custom metrics to Lightstep – this is because the metrics SDK continues to be in active development, and is less stable compared to the Metrics API Specification.

Please consult the following external resources for more information on the metrics protocol, service, and specification:

Frequently Asked Questions

What are the allowed characters for metric names and labels?

Metric names and label keys should meet the following requirements: [a-Z][0-9][\.-/]+. Label keys should be less than 100 characters, and values should be less than 1000 characters.

What happens to values with different labels but the same name?

Each unique combination of name and labels corresponds to a single time series.

Future Considerations

OpenTelemetry continues to be developed, and Lightstep will continue to support OpenTelemetry.

Protocol Support

As new versions of the OpenTelemetry Protocol are released by the project, we will support them for data ingest. We will also deprecate releases over time as they are no longer used by OpenTelemetry SDKs and tools.

Release History

OTLP v0.1 - v0.4 These releases were never supported by Lightstep.

OTLP v0.5 This release is currently supported through the appropriate ingest path.

OTLP v0.6 This release had no changes to the metrics protocol.

OTLP v0.7 This release is currently supported through the appropriate ingest path.

OTLP v0.8 This release is not recommended and is not currently supported.

OTLP v0.9 This release is expected to be supported in Q321.

OTLP v0.10 This version of OTLP is currently unreleased. We anticipate support for it in Lightstep by Q421.

Histograms

As of OpenTelemetry Metrics v0.5, we accept Histogram data points with explicit boundaries. Currently, our metrics system implements Histograms with log-linear boundaries. Upon ingestion, Lightstep will interpolate OpenTelemetry Histograms into log-linear histograms.

The OpenTelemetry metrics group is currently evaluating decisions on long-term histogram support and default histogram aggregations. See this discussion for more information.

We will continue to support OpenTelemetry as histogram encoding support evolves, and we expect to store OpenTelemetry histogram data without interpolation directly in the future.

Validation Errors

Lightstep Metrics applies several forms of validation to incoming metric points, in addition to any rules set by the OpenTelemetry project concerning valid OTLP points. Common validation errors include the following:

  • Change of instrument type (e.g., Counter to Gauge)
  • Metric points greater than 24 hours old
  • Empty metric name

When Lightstep receives metric data from an OTLP source with invalid points, it returns success to the calling process as to ensure that the message is not retried.

We return several pieces of information to assist you in diagnosing metrics ingestion problems. The OpenTelemetry project has not formalized a structured error reporting format, nor semantic conventions for relaying errors at this time. Lightstep has elected to emit this data in HTTP Response trailers.

As response trailers are limited in size, and since validation errors are likely to repeat, we return counts describing the problem and a single example error per request, including the metric name and an explanation of the error. These trailers, described below, are set when an export request is successfully processed with one or more validation errors present:

  • otlp-metrics-dropped:. This response trailer is set with the number of whole metric series dropped due to validation errors. These errors include an empty metric name or an unrecognized point kind.
  • `otlp-points-dropped:’. This response trailer is set with the number of points dropped due to validation errors. These errors include data over 24 hours old, or a change in instrument type.
  • otlp-invalid-*:. This response trailer consists of a short, hyphenated string that explains the reason the point or series was considered invalid, as well as the name of the metric that caused the error.

An example of parsing these trailers can be found in our Prometheus sidecar.