-
Notifications
You must be signed in to change notification settings - Fork 889
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 stdout/json OTLP protocol (instead of OTLP file exporter) #4056
Comments
PTAL @open-telemetry/specs-logs-approvers (especially @djaglowski as I think you are involved in related stuff) |
I find this quite useful in all scenarios where export through a network is not always straightforward / possible, for example. |
How is this different from the file exporter ? |
@marcalff, thanks a lot. I was not aware of it ❤️ The main difference are:
Do you think it is good to define the OTLP file exporter as separate exporter? How a user can select OTLP file exporter a using |
Yes, but this is my own opinion. Currently, the OTLP exporter supports the HTTP and GRPC protocols, with a lot of common configuration options. Having the same OTLP exporter also support FILE will lead to confusion, because many configurations options do not apply to file, for example all the SSL related options. This is clearer I think:
And beside, looking at the technical dependencies point of view, one may not want to link with the gRPC library just to print json to a file, this is sensitive in particular for C++. Having separate exporters allows to pick (or not) a given exporter without having to link with too much third party code. As for changing or expanding existing environment variables, this goes into the configuration territory, where major work is in progress. See:
And for pointers to all relevant issues:
cc @jack-berg |
@marcalff I think the fact whether an protocol is implemented as separate exporter is an implementation detail. The question is whether one selecting it via env var (or configuration) should set
|
I think the current structure makes more sense as OTLP Exporters are capable of sending telemetry directly to the backend whereas the OTLP File Exporter only stores data to an intermediate storage (file). Therefore, I find having I am closing this issue and I plan creating a new one for adding env var support for https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/file-exporter.md. @marcalff, thanks for your input. |
We use operating system tracing techniques for achieving similar goals (and many more!) by exporting telemetry to Windows ETW, Linux user_events. There are such exporters available today in C++, Rust, .NET (Windows ETW only). (One thing with stdout is the need for some synchronization mechanism/locking to avoid mixing of the output, which would impact performance/throughput, which are avoided in the above etw/user_events exporters) Glad to see similar needs being discussed! |
What are you trying to achieve?
I saw/heard (forgive me no actual references, but I imagine many of you could heard the same) asks for having some standardized way of emitting telemetry to stdout. See: #3565.
The most frequent reason is that some prefer to have logs emitted to stdout rather than OTLP so that
I feel that this would be especially beneficial for logging where usage of fluentbit is popular and because there are reasons behind https://12factor.net/logs.
I believe that there could be similar desire for other signals. Therefore, I think we might want to have an OTLP exporter which sends telemetry to an output stream (stdout, stderr, file).
I think the easiest way would be to evolve
http/json
protocol so that it additionally contains information about the signals.E.g.
We could name such protocol
stdout/json
.We could additionally define an
OTEL_EXPORTER_OTLP_STREAM
env var which would default tostdout
(acceptable values:stdout
,stderr
,none
). We may also consider usingOTEL_EXPORTER_OTLP_STREAM
to send telemetry to a file or create a seperate env var for this. Maybe it would be needed anyAdditional context.
Solves #3565
This would require changing:
The collector could also have a capability to receive the telemetry (stdout operator?) send via OTLP/stdout/json so that it can then export it furhter via OTLP/HTTP. This way even if the application crashes, the collector would still be able to pass the data via OTLP to the backend.
What is more some users may prefer to use a logging library appender/sinks/formatter that would emit stdout/json encoded output without going through the OTel SDK to save some performance.
Side note: We already have console exporters, but they are meant for debugging. This is an OTLP exporter which is meant for production use.
EDIT: I was not aware of OTLP File Exporter. Here are some reasons why it may be better to have it as a protocol instead of a separate exporter.
Alternative
Add env var support for OTLP File Exporter
The text was updated successfully, but these errors were encountered: