-
Notifications
You must be signed in to change notification settings - Fork 874
Distributor: add experimental OTLP metrics ingestion over gRPC #7873
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
Open
friedrichg
wants to merge
1
commit into
master
Choose a base branch
from
otlp-grpc-ingestion
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+786
−30
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,6 +27,7 @@ For the sake of clarity, in this document we have grouped API endpoints by servi | |
| | [Fgprof](#fgprof) | _All services_ || `GET /debug/fgprof` | | ||
| | [Remote write](#remote-write) | Distributor || `POST /api/v1/push` | | ||
| | [OTLP receiver](#otlp-receiver) | Distributor || `POST /api/v1/otlp/v1/metrics` | | ||
| | [OTLP receiver (gRPC)](#otlp-receiver-grpc) | Distributor || gRPC `opentelemetry.proto.collector.metrics.v1.MetricsService/Export` | | ||
| | [Tenants stats](#tenants-stats) | Distributor || `GET /distributor/all_user_stats` | | ||
| | [HA tracker status](#ha-tracker-status) | Distributor || `GET /distributor/ha_tracker` | | ||
| | [Flush blocks](#flush-blocks) | Ingester || `GET,POST /ingester/flush` | | ||
|
|
@@ -232,6 +233,34 @@ This API endpoint accepts a HTTP POST request using [OTLP](https://opentelemetry | |
|
|
||
| _Requires [authentication](#authentication)._ | ||
|
|
||
| ### OTLP Receiver (gRPC) | ||
|
|
||
| ``` | ||
| gRPC opentelemetry.proto.collector.metrics.v1.MetricsService/Export | ||
| ``` | ||
|
|
||
| Entrypoint for the OTLP Receiver over gRPC. It is experimental, and it is disabled by default. Enable it with `-distributor.otlp.grpc-enabled=true`. | ||
|
|
||
| This gRPC service accepts the standard [OTLP](https://opentelemetry.io/docs/specs/otlp/) metrics export request on the distributor gRPC server port (`-server.grpc-listen-port`). The conversion to Prometheus series is the same as for the HTTP endpoint, and it uses the same `-distributor.otlp.*` flags. | ||
|
|
||
| - The tenant is read from the `X-Scope-OrgID` gRPC metadata. When `-auth.enabled=true`, a request without it is rejected. | ||
| - The maximum request size is set by `-server.grpc-max-recv-msg-size-bytes` (default 4 MiB), not by `-distributor.otlp-max-recv-msg-size`. The server rejects a larger request with `RESOURCE_EXHAUSTED`. Increase the limit, or decrease the batch size in the OpenTelemetry Collector. | ||
| - When some metrics cannot be converted (for example delta temporality metrics when `-distributor.otlp.allow-delta-temporality=false`), the other metrics are ingested, and the response is a partial success with an error message. The `rejected_data_points` field is always 0, because the number of dropped data points is not known. | ||
|
|
||
| Errors are returned with status codes that let OTLP clients decide if they retry: | ||
|
|
||
| | Distributor result | gRPC status code | Retried by OTLP clients | | ||
| |---|---|---| | ||
| | Request deduplicated by the HA tracker | `OK` | No | | ||
| | Invalid request (HTTP 4xx) | `INVALID_ARGUMENT` | No | | ||
| | Missing or wrong tenant | `UNAUTHENTICATED` / `PERMISSION_DENIED` | No | | ||
| | Rate limited (HTTP 429) | `UNAVAILABLE` | Yes | | ||
| | Server error (HTTP 5xx) | `UNAVAILABLE` | Yes | | ||
| | Client canceled the request | `CANCELED` | No | | ||
| | Deadline exceeded | `DEADLINE_EXCEEDED` | Yes | | ||
|
|
||
| _Requires [authentication](#authentication)._ | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The authentication link points to a section that describes the |
||
|
|
||
| ### Distributor ring status | ||
|
|
||
| ``` | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Current
ServerUserHeaderInterceptorbehavior emitsUNKNOWNasServerUserHeaderInterceptorbeforeExportruns in the missing tenant case, so the client getsUNKNOWN, the same as for every other gRPC method.I think we should change the interceptor in
fakeauth.SetupAuthMiddlewareto returncodes.Unauthenticatedforuser.ErrNoOrgID, since this is the first gRPC API we expose to external clients.