-
Notifications
You must be signed in to change notification settings - Fork 894
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
Do we need a spec for console output format? #3565
Comments
There two possible categories of output by console exporter, lossless data dump or a summary format like
|
Yes. In Collector we have a human-readable, detailed (but probably ambiguous) text format: https://github.com/open-telemetry/opentelemetry-collector/tree/main/exporter/loggingexporter PHP SDK's console exporter which I was reviewing recently uses json, which appears to be non-ambiguous, but also is not OTLP/JSON. It may be worth checking to see what other SDKs do. |
big +1 to this, as it would also significantly improve the docs, right now the outputs per language look very different:
Having a consistent output would make debugging easier and also allow us (@open-telemetry/docs-approvers) to create some more consistent documentation and with that a better experience for the end-users. To add this as an additional note, there is also no consistency on the name of that exporter (I see console, stdout, logging, ostream), which I am less worried about, but this is also reflected in the value I need to set console output via an environment variable. |
Personally, I think it'd be nice to have but not necessary to consolidate the human-readable log output across all SDKs. They all contain pretty much the same information and it should be relatively straightforward to orient oneself quickly when switching between them. One thing that should be normalized, however, is the representation of the Trace IDs and Span IDs. Seems like the following representations are currently used as per the examples that @svrnm (thank you!) gathered above: JS (lowercase hex string)
Erlang (decimal)
Java (lowercase hex string)
Python (lowercase hex string with a
C++ (lowercase hex string)
I think going with a lowercase hex string (either with or without the |
One big advantage is that the output for language SDKs is typically displayed in a format the language developers are already used to seeing. For example in Ruby the There are several things that could be specified and we can do all or none of them:
Personally most of the time I'm using the console logger as a debugging tool just to see that spans/metrics/logs are being collected and exported at all. Usually I don't care about most of the data there. Sometimes, when I am developing instrumentation I care about a specific set of attributes. There are many attributes like trace flags that I almost never care about. Here's what I would suggest we specify:
I would not specify the structure of the overall object itself such as JSON/YAML/etc. I would leave a non-normative hint that the target audience is developers of the language debugging their telemetry and that the data should be in a format that users of that programming language are likely to be regularly familiar with. |
Hmmm. I like the idea of language-specific idioms. I think the main challenge isn't one of uniformity, but of verbosity. Some languages (like .NET) use a nice and compact format. Others (like JS and Python) do not, so it's harder to scan for things. |
I also prefer a compact format most of the time. In JS the reason we decided on the verbose format was mainly because we were using it to develop the SDK itself and were frequently looking at specific data. It was never really meant for end users in the early days. In a lot of ways it still isn't beyond day 0 demos. |
Makes sense. I think I'd be unambiguously in favor of the spec offering general guidance on readability/compactness of outputs. If it's a blessed path + there's some general guidelines to follow, then that's a nice thing for outside contributors to pick up as a pure value-add. |
Many (all?) language SDKs have a "console" exporter that allows outputting the produced telemetry to standard output. This is very useful for getting started, debugging, etc.
The spec does not define a format for this exporter and I think language maintainers usually come up with the own formats.
Should we define a format that all SDKs can implement uniformly?
We do define a file exporter format, but console likely has requirements that will make it different (i.e. human readability is likely a top priority).
Related to discussion about this in PHP repo: open-telemetry/opentelemetry-php#1050
@open-telemetry/specs-approvers any thoughts?
The text was updated successfully, but these errors were encountered: