[exporter/debug] make normal
verbosity output one line per telemetry item
#9298
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.
🚧 WORK IS IN PROGRESS 🚧
Description:
The Debug exporter's behavior of
normal
verbosity used to be the same as forbasic
verbosity, which is to output only one line of text for each telemetry batch.This changes the behavior of
normal
verbosity to output one line of text for each telemetry item - log record, metric data point, or span. This is a good middle ground betweenbasic
(one line per telemetry batch) anddetailed
(multiple lines per telemetry item).Note that this change only applies to the Debug exporter; the deprecated Logging exporter keeps old behavior.
I've marked this change as
breaking
, but I'm not sure if we want to consider changes in Debug exporter's format as breaking changes?While this PR is in progress, any suggestions on the formatting are welcome. Especially for spans, which I don't have a lot of experience with.
Here's the current output for logs:
Notes:
I don't love the fact that each output from the Debug exporter is prefixed with the timestamp and
info
level string, and suffixed by some more text like{"kind": "exporter", "data_type": "logs", "name": "debug"}
. This makes the output inconsistent.I also believe the Debug exporter should send its output to
stdout
by default and not tostderr
where all collector logs are sent. I believe Debug exporter's output is functionally different from collector logs and belongs tostdout
, as this is what the user expects to see as the collector's output, having configured the Debug exporter.Link to tracking Issue:
Testing:
TODO add tests specifying the behavior
Documentation:
TODO update Debug exporter's README to describe the format
Next steps:
(As a future separate PR) I believe it would be beneficial for users to be able to configure the output format - for example:
output.attributes
whether or not to include records' attributes. They're probably essential for metrics, but for logs - it depends on the nature of the logs. For some users, attributes may be essential; for others, they only obscure the output.output.trace_id
,output.span_id
whether or not to include trace ID, span ID - probably essential for traces, but not necessarily for logs.output.timestamp
whether or not to include timestamp - again some users might find them useful, others might want to remove them for clarity