-
Notifications
You must be signed in to change notification settings - Fork 822
Logs exporter: {OriginalFormat}
should be exported as message_template.text
#4400
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
Comments
Agree about the awkward name {OriginalFormat}. There is some wip (#4334) which would be relevant to this as well. |
I think if the goal is to define a "standard" spot for message template(s) we should approach this through the OpenTelemetry Specification. /cc @alanwest |
That sounds great; thank you both for taking a look 👍 I can't add much to the discussion at this point, but if you're able to loop me in or link to spec discussions here I'd love to follow along. |
@cijothomas in that default mode, is there any way for consuming tools to detect that the body is a template (vs the fully-rendered message)? Knowing that the body is a template opens up the possibility of rendering on demand, for example when the event is viewed by a human user. Here's how that kind of thing looks in Seq, for example: (The screenshot's using the |
Looking for the placeholders (curly braces) would be the way to go, as there is no other indication if body is formatted one or the template itself. Some tools like AzureDataExplorer has (experimental) support for filling in the placeholders from attributes. |
Nice! Sounds like a reliable (non-heuristic) method of determining that the body is a template could also benefit them? (Do you know if anyone involved with it is reachable here?) |
https://github.com/open-telemetry/opentelemetry-dotnet/pull/4334/files#diff-e28eaa16d5ac47130740a2783c474f316e9a1699aa3ada3a537951246e7cf517L123 This PR keeps the same behavior. So if you do |
I do not think so. The Azure Data Explorer is not an OSS product, so I can't just point to source code of it handling the messagetemplate replacement! https://messagetemplates.org/ - Do check this out, as it may have some leads. |
Thanks for your reply! Sorry, I was unclear - I didn't mean that ADX might have a non-heuristic method of detecting message templates, but rather that the product team would be interested in gaining one, i.e. via one of the mechanisms we're discussing. Detecting message templates heuristically is possible, but there's a computational cost and false-positive rate that would be avoided with a standardized attribute name (or other marker, in the case that the template is in |
Currently with it would be nice to have the When we use APM tools like Elastic Cloud, Splunk Observability etc., We would like to optimise the cost of log data storage. reducing these duplicates will be much helpful.
|
@rpanand24 Are you seeing duplicate information when using OTLP Exporter? The above seems to be the output of console exporter, and might not reflect what actually gets send to APM backends, when using OTLP Exporter! |
Is there a consensus for what to do with this issue? I'm happy to submit a PR to address this. For reference, we are using Serilog + OpenTelemetry (with
|
This issue was marked stale due to lack of activity and will be closed in 7 days. Commenting will instruct the bot to automatically remove the label. This bot runs once per day. |
This still seems like a gap worth closing; |
Feature request
The .NET Logs exporter includes the log event's message template in the oddly-named
{OriginalFormat}
field.E.g. when
IncludeFormattedMessage = true
, sending an event with:results in a
LogRecord
with an attribute named"{OriginalFormat}"
, and value"Hello, {name}"
.It's great (crucial) having this data attached to the log record, but the name is inappropriate and awkward.
Ideally, since the value is a message template, it would be called something like
message_template.text
or a similarly descriptive name.Alternatives
A simple name like
message_template
would also work, but makes implementation of additional message template-derived attributes harder to name. Using the.text
suffix leaves the path clear for other attributes to be included undermessage_template.*
.Additional Context
Message templates were originally implemented by Serilog, were inherited by MEL, and are now supported across a number of different libraries and ecosystems including all of the .NET logging libraries currently in wide use.
Using a standard attribute name for the message template will collectively benefit all consumers that use it. The Serilog OTLP implementation is intending to use the attribute
message_template.text
.The text was updated successfully, but these errors were encountered: