Skip to content
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

Set ECS fields from message templates #229

Merged
merged 1 commit into from
Jan 16, 2023
Merged

Set ECS fields from message templates #229

merged 1 commit into from
Jan 16, 2023

Conversation

Mpdreamz
Copy link
Member

@Mpdreamz Mpdreamz commented Jan 16, 2023

This allows most ECS fields to be set directly from message templates
e.g

Log.Info("{TraceId}", "x"); 

will override trace.id and not assign metadata.TraceId to x.

This only supports ECS fields not part of an array as documented by LogTemplateProperties.*

This contains two breaking changes.

  1. Unknown properties no longer ALL go to _metadata.
    If the unknown property is a string or boolean it will be set to the more appropriate labels.* ECS field.
    See: https://github.com/elastic/ecs-dotnet/pull/229/files#diff-c8cee7db06f2fb88e3d446bba43979c060043f289cb18273985dce0a907f0d22R31
  2. Known ECS fields in message template properties now directly assign to the appropriate ECS fields if the type matches. Otherwise it will fallback to assigning to labels.* or _metadata.*

@Mpdreamz Mpdreamz added enhancement New feature or request breaking v8.4.0 labels Jan 16, 2023
@apmmachine
Copy link
Contributor

apmmachine commented Jan 16, 2023

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2023-01-16T14:41:29.672+0000

  • Duration: 19 min 4 sec

Test stats 🧪

Test Results
Failed 0
Passed 174
Skipped 2
Total 176

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@Mpdreamz Mpdreamz requested a review from z1c0 January 16, 2023 13:42
This allows most ECS fields to be set directly from message templates
e.g

Log.Info("{TraceId}", "x"); will override `trace.id` and not assign
`metadata.TraceId` to `x`.

This only supports ecs fields not part of an array.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking enhancement New feature or request v8.4.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants