Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: adds instructions for collecting and sending native histograms with otel collector #9328

Merged
merged 16 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 0 additions & 35 deletions docs/sources/mimir/send/native-histograms/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,41 +184,6 @@ Use the latest version of [Grafana Alloy](https://grafana.com/docs/alloy/<ALLOY_
}
```

## Collect and send exponential histograms with the OpenTelemetry Collector

OpenTelemetry [exponential histograms](https://opentelemetry.io/docs/specs/otel/metrics/data-model/#exponentialhistogram) are compatible with Prometheus native histograms. The only significant difference is that exponential histograms store the `min` and `max` observation values explicitly, but native histograms don't, which means you need to estimate the minimum and maximum by using the 0.0 and 1.0 quantile respectively.

Use the OpenTelemetry Collector to collect and send exponential histograms. The Collector supports collecting exponential histograms or other compatible data formats (for example native histograms, DataDog sketches, etc) through its receivers. The Collector also supports sending the exponential histograms or compatible data formats such as native histograms through its exporters.

Note: the availability of different receivers and exporters depends on your Collector [distribution](https://opentelemetry.io/docs/concepts/distributions/).

Grafana Mimir can receive exponential histograms as is via the OTLP protocol or as Prometheus native histograms over the Prometheus remote write protocol.

OpenTelemetry supports instrumenting applications with the OpenTelemetry SDK. Multiple languages are supported, for the complete list see [Language APIs & SDKs](https://opentelemetry.io/docs/languages/).

### Instrument a Go application with the OpenTelemetry SDK

Use the OpenTelemetry SDK version 1.17.0 or later for Go.

1. Set up the collector to handle your metrics data. This includes setting up your resources, meter provider, meter, instruments, and views. Refer to [Metrics](https://opentelemetry.io/docs/languages/go/instrumentation/#metrics) in the OpenTelemetry SDK documentation for Go.
1. To aggregate a histogram instrument as an exponential histogram, include the following view:

```
Aggregation: metric.AggregationBase2ExponentialHistogram{
MaxSize: 160,
MaxScale: 20,
}
```

For more information, refer to [Registering Views](https://opentelemetry.io/docs/languages/go/instrumentation/#registering-views) in the OpenTelemetry SDK documentation for Go.

### Instrument the OpenTelemetry Collector using Java

Use the OpenTelemetry SDK version 1.35.0 or later.

1. Set up the collector to handle your metrics data. This includes setting up your resources, meter provider, meter, instruments, and views. Refer to [Metrics](https://opentelemetry.io/docs/languages/java/instrumentation/#metrics) in the OpenTelemetry SDK documentation for Java.
1. To aggregate a histogram instrument as an exponential histogram, include the following view:

## Migrate from classic histograms

To ease the migration process, you can keep the custom bucket definition of a classic histogram and add native histogram buckets at the same time.
Expand Down
36 changes: 36 additions & 0 deletions docs/sources/mimir/send/otel-exponential-histograms/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
description: Learn how to collect and send exponential histograms with the OpenTelemetry Collector
menuTitle: OpenTelemetry exponential histograms
title: Collect and send exponential histograms with the OpenTelemetry Collector
weight: 100
---

# Collect and send exponential histograms with the OpenTelemetry Collector

OpenTelemetry [exponential histograms](https://opentelemetry.io/docs/specs/otel/metrics/data-model/#exponentialhistogram) are compatible with Prometheus native histograms. The only significant difference is that exponential histograms store the `min` and `max` observation values explicitly, but native histograms don't, which means you need to estimate the minimum and maximum by using the 0.0 and 1.0 quantile respectively.

Use the OpenTelemetry Collector to collect and send exponential histograms. The Collector supports collecting exponential histograms or other compatible data formats (for example native histograms, DataDog sketches, etc) through its receivers. The Collector also supports sending the exponential histograms or compatible data formats such as native histograms through its exporters.

Note: the availability of different receivers and exporters depends on your Collector [distribution](https://opentelemetry.io/docs/concepts/distributions/).

Grafana Mimir can receive exponential histograms as is via the OTLP protocol or as Prometheus native histograms over the Prometheus remote write protocol.

OpenTelemetry supports instrumenting applications with the OpenTelemetry SDK. Multiple languages are supported, for the complete list see [Language APIs & SDKs](https://opentelemetry.io/docs/languages/).

## Instrument a Go application with the OpenTelemetry SDK

Use the OpenTelemetry SDK version 1.17.0 or later for Go.

1. Set up the collector to handle your metrics data. This includes setting up your resources, meter provider, meter, instruments, and views. Refer to [Metrics](https://opentelemetry.io/docs/languages/go/instrumentation/#metrics) in the OpenTelemetry SDK documentation for Go.
1. To aggregate a histogram instrument as an exponential histogram, include the following view:

```
Aggregation: metric.AggregationBase2ExponentialHistogram{
MaxSize: 160,
MaxScale: 20,
}
```

For more information, refer to [Registering Views](https://opentelemetry.io/docs/languages/go/instrumentation/#registering-views) in the OpenTelemetry SDK documentation for Go.
tacole02 marked this conversation as resolved.
Show resolved Hide resolved

## Migrate from classic histograms
tacole02 marked this conversation as resolved.
Show resolved Hide resolved
Loading