-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
OTLP: Support receiving logs in Loki using OpenTelemetry OTLP #7280
Conversation
|
I'm not sure what's the best place to document this. There aren't configuration options, the only things to mention would be:
|
This change brings support to ingesting OTLP as part of the main ingester. This uses the standard OpenTelemetry Collector pdata Logs gRPC server as the interface and the translator package from the contrib repository. Once the data is translated from OTLP to a Loki's PushRequest, we call use the Ingester's Push function. Fixes grafana#5346 Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>
fa72999
to
a62d139
Compare
./tools/diff_coverage.sh ../loki-main/test_results.txt test_results.txt ingester,distributor,querier,querier/queryrange,iter,storage,chunkenc,logql,loki Change in test coverage per package. Green indicates 0 or positive change, red indicates that test coverage for a package fell. + ingester 0%
+ distributor 0%
+ querier 0%
+ querier/queryrange 0.1%
+ iter 0%
+ storage 0%
+ chunkenc 0%
+ logql 0%
+ loki 0.1% |
var _ plogotlp.Server = (*Server)(nil) | ||
|
||
// Server is an OpenTelemetry Collector Logs gRPC server which converts OTLP | ||
// into Loki's PushRequest and forwards the requeste to the provided PusherServer. |
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.
// into Loki's PushRequest and forwards the requeste to the provided PusherServer. | |
// into Loki's PushRequest and forwards the request to the provided PusherServer. |
@@ -54,7 +54,7 @@ require ( | |||
github.com/grafana/regexp v0.0.0-20220304100321-149c8afcd6cb | |||
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 | |||
github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 | |||
github.com/hashicorp/consul/api v1.13.0 | |||
github.com/hashicorp/consul/api v1.15.2 |
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.
Are all these version changes needed for oltp? If not I'd prefer it if they were in a separate PR.
I'm closing this as we decided not to pursue this at the moment. |
This is still something that is high on our list of desired features. Is there still a desire on Grafana's part to deliver native OTLP ingestion for Loki? |
Right now, we are working on a proxy for Grafana Cloud that would be able to ingest all three signals. Native OTLP ingestion for Loki will eventually land here, but some other base work has to be completed before. |
Native OTLP ingestion is definitely on our list, but we are still working out how best to store the additional structured data sent with OTLP. The This PR takes the same approach as the Loki exporter which allows selective mapping of attributes to labels but this only will work for low cardinality attributes. We recommend using the collector and exporter until we can natively support and store all the data in the OTLP payload directly in Loki, however to do this we need to make some store changes to make a place for structured data. |
@slim-bean are there any plans to extend the Loki data store to handle attributes like traceID/spanID or other correlators efficiently? I mean this would be required before dumping all the OTLP-compliant data into Loki. |
Yes there are plans for this! Most of us are just getting back up to speed after some holiday time off and I know there are a few meetings scheduled to talk about this in the coming weeks. Optimistically I hope we can have something started in Q1 this year. |
Is there some kind of public roadmap? |
What this PR does / why we need it:
This change brings support to ingesting OTLP as part of the main
ingester. This uses the standard OpenTelemetry Collector pdata
Logs gRPC server as the interface and the translator package
from the contrib repository. Once the data is translated from OTLP
to a Loki's PushRequest, we call use the Ingester's Push function.
Which issue(s) this PR fixes:
Fixes #5346
Special notes for your reviewer:
Most of this change is about bringing new dependencies. The code itself is quite simple, just making bridges. I tested this with an OpenTelemetry Collector Contrib with the following configuration:
Checklist
CONTRIBUTING.md
guideCHANGELOG.md
updateddocs/sources/upgrading/_index.md
Signed-off-by: Juraci Paixão Kröhling juraci@kroehling.de