-
Notifications
You must be signed in to change notification settings - Fork 512
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
Add OTLP input API #695
Add OTLP input API #695
Conversation
8673a85
to
3955742
Compare
9e3a070
to
8cb98ab
Compare
8cb98ab
to
1e424af
Compare
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.
Good job! This PR is getting in a bunch of vendor updates. What's actually required? For example, I've seen you've upgraded vendored Prometheus, but we have a replace
directive about it in go.mod
so no vendored Prometheus code has changed.
Few more things, please:
- Could you add a CHANGELOG entry?
- Could me list it among the experimental features listed at
docs/sources/configuration/about-versioning.md
?
pkg/api/api.go
Outdated
@@ -228,6 +228,7 @@ func (a *API) RegisterDistributor(d *distributor.Distributor, pushConfig distrib | |||
distributorpb.RegisterDistributorServer(a.server.GRPC, d) | |||
|
|||
a.RegisterRoute("/api/v1/push", push.Handler(pushConfig.MaxRecvMsgSize, a.sourceIPs, a.cfg.SkipLabelNameValidationHeader, a.cfg.wrapDistributorPush(d)), true, "POST") | |||
a.RegisterRoute("/api/v1/push/otlp/v1/metrics", push.HandlerForOTLP(pushConfig.MaxRecvMsgSize, a.sourceIPs, a.cfg.SkipLabelNameValidationHeader, a.cfg.wrapDistributorPush(d)), true, "POST") |
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.
Why two "v1" in the path? Also have you considered keeping "/push" at the end, so something like "/api/v1/otlp/metrics/push"?
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.
This is mainly because OTLP expects v1/metrics
at the end: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/otlp.md#otlphttp
Can we do another route though?
This is a copy-paste message. I've just cut the CHANGELOG in preparation to Mimir 2.0.0 release. Could you rebase |
01afbc0
to
a780e4b
Compare
@pracucci Thanks a lot for the review, I've addressed all your comments and I think this is now good to go!
I've checked those, and I am not sure if I should look at indirect dependencies as well. I've looked at direct dependencies and:
Should I revert the Prometheus update or just keep it as-is? |
fd9f038
to
5062ac1
Compare
This look great, I only had minor comments |
Please rebase this PR on top of |
3caff73
to
9232911
Compare
ab055f7
to
a1e682f
Compare
Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com>
Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com>
Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com>
ed76fb3
to
a40aa9d
Compare
Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com>
Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com>
a40aa9d
to
fa55606
Compare
otel-collector: | ||
image: otel/opentelemetry-collector-contrib:0.54.0 | ||
command: ["--config=/etc/otel-collector/otel-collector.yaml"] | ||
depends_on: | ||
- mimir-1 | ||
volumes: | ||
- ./config:/etc/otel-collector | ||
ports: | ||
- 8083:8083 |
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.
Is this otel-collector the only things different in mimir-with-oltp
?
I have concerns about having to maintain one more development setup which is probably the same as the one for s3 + otel-collector.
Maybe I'm missing something, then maybe we could have a README.md in this development/mimir-with-oltp
that would clarify?
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.
I have the same concern. I don't understand the need of a dedicated dev env.
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.
I would just remove development/mimir-with-otlp/
and add OT collector to development/tsdb-blocks-storage-s3
.
Can you also update the documentation please? Edit: could be a separate review also, to include docs squad in a narrower changeset. |
fa55606
to
4ec4e5b
Compare
I've addressed your changes. I'll add the docs in a separate PR yes. |
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.
LGTM, thank you!
Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com>
4ec4e5b
to
9a4aeab
Compare
messageSizeLargerErrFmt = "received message larger than max (%d > %d)" | ||
) | ||
|
||
func OLTPHandler( |
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.
I think we have a typo here. Shouldn't be OTLPHandler()
?
wrappedDistributor := a.cfg.wrapDistributorPush(d) | ||
|
||
a.RegisterRoute("/api/v1/push", push.Handler(pushConfig.MaxRecvMsgSize, a.sourceIPs, a.cfg.SkipLabelNameValidationHeader, wrappedDistributor), true, false, "POST") | ||
a.RegisterRoute("/api/v1/push/otlp/v1/metrics", push.OLTPHandler(pushConfig.MaxRecvMsgSize, a.sourceIPs, a.cfg.SkipLabelNameValidationHeader, wrappedDistributor), true, false, "POST") |
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.
/api/v1/push/otlp/v1/metrics
looks weird to me, with that double versioning. What if we simply use /otlp/v1/metrics
?
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.
Related: #695 (comment)
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.
Also works. I'll open a PR with all your feedback now.
Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com>
* Final feedback from #695 (OTLP) Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com> * Fixed client used in integration tests and CHANGELOG entry Signed-off-by: Marco Pracucci <marco@pracucci.com> * Added PR number to CHANGELOG Signed-off-by: Marco Pracucci <marco@pracucci.com> Co-authored-by: Marco Pracucci <marco@pracucci.com>
What this PR does:
OTLP ingest path.
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]