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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

tacole02
Copy link
Contributor

@tacole02 tacole02 commented Sep 18, 2024

What this PR does

This PR updates https://grafana.com/docs/mimir/next/send/native-histograms/ with instructions for collecting and sending native histograms with the OTel Collector.

Which issue(s) this PR fixes or relates to

Fixes https://github.com/grafana/mimir-squad/issues/2131)](https://github.com/grafana/mimir-squad/issues/2131

Checklist

  • Tests updated.
  • Documentation added.
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX].
  • about-versioning.md updated with experimental features.

@tacole02 tacole02 added the type/docs Improvements or additions to documentation label Sep 18, 2024
@tacole02 tacole02 self-assigned this Sep 18, 2024
@tacole02 tacole02 requested a review from a team as a code owner September 18, 2024 19:56
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:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@krajorama could you please provide an example implementation for Java? Thanks!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tried to set it up, but I don't have enough Java experience at this point to get it to work, I suggest we stick to Go for now. Maybe someone can contribute the Java parts once we have the structure and everything figured out for Go.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good! I'll make the docs Go-specific for the time being.

docs/sources/mimir/send/native-histograms/_index.md Outdated Show resolved Hide resolved
docs/sources/mimir/send/native-histograms/_index.md Outdated Show resolved Hide resolved
docs/sources/mimir/send/native-histograms/_index.md Outdated Show resolved Hide resolved
docs/sources/mimir/send/native-histograms/_index.md Outdated Show resolved Hide resolved
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:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tried to set it up, but I don't have enough Java experience at this point to get it to work, I suggest we stick to Go for now. Maybe someone can contribute the Java parts once we have the structure and everything figured out for Go.

}
```

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


# Send exponential histograms to Mimir

You can collect and send exponential histograms to Mimir with the OpenTelemetry Collector. OpenTelemetry [exponential histograms](https://opentelemetry.io/docs/specs/otel/metrics/data-model/#exponentialhistogram) are compatible with Prometheus native histograms. The key difference is that exponential histograms store the `min` and `max` observation values explicitly, whereas native histograms don't. This means that for exponential histograms, you don't need to estimate these values using the 0.0 and 1.0 quantiles.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@krajorama , I massaged this a little bit to keep the topic's focus on exponential histograms. lmk if this works.


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

## Migrate from classic histograms
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@krajorama do the migration instructions at https://grafana.com/docs/mimir/next/send/native-histograms/#migrate-from-classic-histograms not apply here? If that's the case, how can people migrate?


## Migrate from classic histograms

## Bucket boundary calculation
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@krajorama same question as above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/docs Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants