Skip to content

Commit

Permalink
Merge branch 'rework-otlp-config' of https://github.com/jack-berg/doc…
Browse files Browse the repository at this point in the history
…s-website into rework-otlp-config
  • Loading branch information
jack-berg committed May 6, 2024
2 parents 5ac18b8 + fd68247 commit 5bf7408
Showing 1 changed file with 20 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,35 @@ tags:
- OpenTelemetry
- OTLP
metaDescription: Configure OTLP exporter for New Relic
freshnessValidatedDate: never
freshnessValidatedDate: 2024-05-06
redirects:
- /docs/more-integrations/open-source-telemetry-integrations/opentelemetry/best-practices/opentelemetry-best-practices-attributes/
- /docs/more-integrations/open-source-telemetry-integrations/opentelemetry/best-practices/opentelemetry-best-practices-batching/
- /docs/more-integrations/open-source-telemetry-integrations/opentelemetry/best-practices/opentelemetry-best-practices-compression/
- /docs/more-integrations/open-source-telemetry-integrations/opentelemetry/best-practices/opentelemetry-best-practices-overview
- /docs/more-integrations/open-source-telemetry-integrations/opentelemetry/best-practices/opentelemetry-best-practices-versions
---

[OpenTelemetry Protocol](https://github.com/open-telemetry/opentelemetry-proto/blob/main/docs/specification.md), or OTLP for short, is a general purpose telemetry data delivery protocol designed for the OpenTelemetry project. Each OpenTelemetry language SDK provides OTLP exporters, and the OpenTelemetry collector has OTLP receivers and exporters. Additionally, various tools outside the OpenTelemetry project have added support for OTLP export.

New Relic supports native OTLP ingest, and recommends it as the preferred method for sending OpenTelemetry data to the New Relic platform. This document delves into New Relic's OTLP support, including configuration requirements and recommendations.

## Config: Before you start [#prereqs]
## Before you begin [#prereqs]

* If you haven't already done so, sign up for a free [New Relic account](https://newrelic.com/signup).
* Get the [license key](https://one.newrelic.com/launcher/api-keys-ui.launcher) for the New Relic account to which you want to report data. This license key will be used to [configure `api-key` header](#api-key)
* Get the [license key](https://one.newrelic.com/launcher/api-keys-ui.launcher) for the New Relic account to which you want to report data. This license key will be used to [configure the `api-key` header](#api-key).

## Config: Endpoint, Port and Protocol [#endpoint-port-protocol]
## Configure the endpoint, port and protocol [#endpoint-port-protocol]

Requirement level: **Required**

In order to configure send OTLP data to New Relic, you must configure your OTLP exporter to use the relevant endpoint and port from the table below based on your environment.

The mechanism to configure the endpoint will vary, but OpenTelemetry language SDKs generally support setting the `OTEL_EXPORTER_OTLP_ENDPOINT=<INSERT_ENDPOINT>` environment variable (see [opentelemetry docs](https://opentelemetry.io/docs/specs/otel/protocol/exporter/) for more info).
The mechanism to configure the endpoint will vary, but OpenTelemetry language SDKs generally support setting the `OTEL_EXPORTER_OTLP_ENDPOINT=<INSERT_ENDPOINT>` environment variable (see [OpenTelemetry docs](https://opentelemetry.io/docs/specs/otel/protocol/exporter/) for more info).

Additionally, you should configure your OTLP exporter to use the [OTLP/HTTP binary protobuf version](https://opentelemetry.io/docs/specs/otlp/#binary-protobuf-encoding) of the protocol if available. While New Relic supports all versions of OTLP, OTLP/HTTP binary protobuf has proved to be more robust than gRPC without any apparent reduction in performance.

The mechanism to configure the endpoint will vary, but OpenTelemetry language SDKs generally support setting the `OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf` environment variable (see [opentelemetry docs](https://opentelemetry.io/docs/specs/otel/protocol/exporter/) for more info).
The mechanism to configure the endpoint will vary, but OpenTelemetry language SDKs generally support setting the `OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf` environment variable (see [OpenTelemetry docs](https://opentelemetry.io/docs/specs/otel/protocol/exporter/) for more info).

If using the collector, prefer the [otlphttpexporter](https://github.com/open-telemetry/opentelemetry-collector/tree/main/exporter/otlphttpexporter).

Expand Down Expand Up @@ -176,15 +182,15 @@ Requirement level: **Required**

In order to send OTLP data to New Relic, you must configure your OTLP exporter to use TLS 1.2 (see [TLS encryption](docs/new-relic-solutions/get-started/networks/#tls) for more information). Generally, SDK and collector exporters meet this requirement by default.

While many OTLP exporters infer TLS settings from the `https` endpoint scheme, some gRPC exporters may require you to explicitly enable TLS. The mechanism to configure gRPC TLS will vary, but OpenTelemetry language SDKs generally support setting the `OTEL_EXPORTER_OTLP_INSECURE=false` environment variable (see [opentelemetry docs](https://opentelemetry.io/docs/specs/otel/protocol/exporter/) for more info).
While many OTLP exporters infer TLS settings from the `https` endpoint scheme, some gRPC exporters may require you to explicitly enable TLS. The mechanism to configure gRPC TLS will vary, but OpenTelemetry language SDKs generally support setting the `OTEL_EXPORTER_OTLP_INSECURE=false` environment variable (see [OpenTelemetry docs](https://opentelemetry.io/docs/specs/otel/protocol/exporter/) for more info).

### Config: Setting the API Key [#api-key]

Requirement level: **Required**

In order to send OTLP data to New Relic, you must configure your OTLP exporter to include a header named `api-key` with the value set to your [license key](#prereqs). Failure to do so will result in authentication errors.

The mechanism to configure headers will vary, but OpenTelemetry language SDKs generally support setting the `OTEL_EXPORTER_OTLP_HEADERS=api-key=<INSERT_LICENSE_KEY>` environment variable (see [opentelemetry docs](https://opentelemetry.io/docs/specs/otel/protocol/exporter/) for more info).
The mechanism to configure headers will vary, but OpenTelemetry language SDKs generally support setting the `OTEL_EXPORTER_OTLP_HEADERS=api-key=<INSERT_LICENSE_KEY>` environment variable (see [OpenTelemetry docs](https://opentelemetry.io/docs/specs/otel/protocol/exporter/) for more info).

## Config: Attribute Limits [#attribute-limits]

Expand All @@ -200,7 +206,7 @@ Attribute limits are as follows:

See [metric attribute limits](/docs/data-apis/ingest-apis/metric-api/metric-api-limits-restricted-attributes/) and [event attribute limits](/docs/data-apis/ingest-apis/event-api/introduction-event-api/#limits) for other limits.

The mechanism to configure attribute limits will vary, but OpenTelemetry language SDKs generally support setting the `OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT=4095` and `OTEL_ATTRIBUTE_COUNT_LIMIT=64` environment variables (see [opentelemetry docs](https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/) for more info).
The mechanism to configure attribute limits will vary, but OpenTelemetry language SDKs generally support setting the `OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT=4095` and `OTEL_ATTRIBUTE_COUNT_LIMIT=64` environment variables (see [OpenTelemetry docs](https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/) for more info).

If using the collector, the [transform processor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/transformprocessor) can be configured to truncate attributes to New Relic limits.

Expand All @@ -219,17 +225,17 @@ Additionally, New Relic imposes [rate limits](/docs/data-apis/manage-data/view-s

To avoid payload size limits and rate limits, you must configure your OTLP exporter to use an appropriate batch size which causes data to be exported on an appropriate interval.

The mechanism for configuring batching will vary. OpenTelemetry SDKs generally support setting the following environment variables (see [opentelemetry docs](https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/) for more info):
The mechanism for configuring batching will vary. OpenTelemetry SDKs generally support setting the following environment variables (see [OpenTelemetry docs](https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/) for more info):

- `OTEL_BSP_*` for spans
- `OTEL_METRIC_EXPORT_*` for metrics
- `OTEL_BLRP_*` for logs

If using the collector, the [batchprocessor](https://github.com/open-telemetry/opentelemetry-collector/tree/main/processor/batchprocessor) controls batch size.
If using the collector, the [batch processor](https://github.com/open-telemetry/opentelemetry-collector/tree/main/processor/batchprocessor) controls batch size.

Additionally, you should enable compression to reduce payload size and limit the likelihood of encountering payload size limits. New Relic supports `gzip` and `zstd` compression. `zstd` compression is higher performance and recommended if your exporter supports it. See [compression comparison](https://github.com/open-telemetry/opentelemetry-collector/blob/main/config/configgrpc/README.md#compression-comparison) for more details on benchmark information.

The mechanism to configure the endpoint will vary, but OpenTelemetry language SDKs generally support setting the `OTEL_EXPORTER_OTLP_COMPRESSION=gzip` environment variable (see [opentelemetry docs](https://opentelemetry.io/docs/specs/otel/protocol/exporter/) for more info).
The mechanism to configure the endpoint will vary, but OpenTelemetry language SDKs generally support setting the `OTEL_EXPORTER_OTLP_COMPRESSION=gzip` environment variable (see [OpenTelemetry docs](https://opentelemetry.io/docs/specs/otel/protocol/exporter/) for more info).

If using the collector, `gzip` is the default compression, but `zstd` can be optionally configured.

Expand All @@ -249,7 +255,7 @@ Requirement level: **Recommended**

In order to send OTLP metric data to New Relic, you should configure your OTLP metrics exporter to prefer delta [aggregation temporality](https://opentelemetry.io/docs/specs/otel/metrics/data-model/#temporality). While New Relic supports cumulative aggregation temporality, the New Relic metrics architecture is generally a delta metrics system. Using the default cumulative setting will generally incur more memory usage from SDKs and result in high data ingest.

The mechanism to configure the endpoint will vary, but OpenTelemetry language SDKs generally support setting the `OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE=delta` environment variable (see [opentelemetry docs](https://opentelemetry.io/docs/specs/otel/metrics/sdk_exporters/otlp/) for more info). If manually setting temporality as a function of instrument kind, configure as follows:
The mechanism to configure the endpoint will vary, but OpenTelemetry language SDKs generally support setting the `OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE=delta` environment variable (see [OpenTelemetry docs](https://opentelemetry.io/docs/specs/otel/metrics/sdk_exporters/otlp/) for more info). If manually setting temporality as a function of instrument kind, configure as follows:

- Counter, Asynchronous Counter, Histogram: Delta
- UpDownCounter, Asynchronous UpDownCounter, Gauge, Asynchronous Gauge: Cumulative
Expand All @@ -262,7 +268,7 @@ Requirement level: **Recommended**

In order to send OTLP metric data to New Relic, you should configure your OTLP metrics exporter to aggregate measurements from histogram instruments to [exponential histograms](https://opentelemetry.io/docs/specs/otel/metrics/data-model/#exponentialhistogram). In contrast to the static buckets used with the default explicit bucket histograms, exponential histograms automatically adjust their buckets to reflect the range of measurements recorded. Additionally, they use a highly compressed representation to send over the wire. Exponential histograms provide more useful distribution data in the New Relic platform.

The mechanism to configure the endpoint will vary, but OpenTelemetry language SDKs generally support setting the `OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION=base2_exponential_bucket_histogram` environment variable (see [opentelemetry docs](https://opentelemetry.io/docs/specs/otel/metrics/sdk_exporters/otlp/) for more info).
The mechanism to configure the endpoint will vary, but OpenTelemetry language SDKs generally support setting the `OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION=base2_exponential_bucket_histogram` environment variable (see [OpenTelemetry docs](https://opentelemetry.io/docs/specs/otel/metrics/sdk_exporters/otlp/) for more info).

## OTLP Protocol Version

Expand Down

0 comments on commit 5bf7408

Please sign in to comment.