Skip to content

[Error logs] Serialize meta.error if it is an instance of Error in JSON layout#244364

Merged
maryam-saeidi merged 2 commits intoelastic:mainfrom
maryam-saeidi:serialize-meta-error
Nov 28, 2025
Merged

[Error logs] Serialize meta.error if it is an instance of Error in JSON layout#244364
maryam-saeidi merged 2 commits intoelastic:mainfrom
maryam-saeidi:serialize-meta-error

Conversation

@maryam-saeidi
Copy link
Member

@maryam-saeidi maryam-saeidi commented Nov 26, 2025

Summary

In this PR, we serialize meta.error to only keep the relevant attributes (message, name, stack) if it is an instance of Error.

Release note

Fixes serialization of meta.error in JSON layouts: if the error is an Error instance, only message, name, and stack will be included — additional fields will no longer pollute the logs.

@maryam-saeidi maryam-saeidi self-assigned this Nov 26, 2025
@maryam-saeidi maryam-saeidi requested a review from a team as a code owner November 26, 2025 14:30
@maryam-saeidi maryam-saeidi added release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting release_note:fix backport:all-open Backport to all branches that could still receive a release and removed release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting labels Nov 26, 2025
Co-authored-by: Rudolf Meijering <skaapgif@gmail.com>
@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

✅ unchanged

cc @maryam-saeidi

@maryam-saeidi maryam-saeidi merged commit 0a29908 into elastic:main Nov 28, 2025
13 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.19, 9.1, 9.2

https://github.com/elastic/kibana/actions/runs/19766854068

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 28, 2025
…ON layout (elastic#244364)

## Summary

In this PR, we serialize meta.error to only keep the relevant attributes
(message, name, stack) if it is an instance of Error.

## Release note

Fixes serialization of meta.error in JSON layouts: if the error is an
Error instance, only message, name, and stack will be included —
additional fields will no longer pollute the logs.

---------

Co-authored-by: Rudolf Meijering <skaapgif@gmail.com>
(cherry picked from commit 0a29908)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 28, 2025
…ON layout (elastic#244364)

## Summary

In this PR, we serialize meta.error to only keep the relevant attributes
(message, name, stack) if it is an instance of Error.

## Release note

Fixes serialization of meta.error in JSON layouts: if the error is an
Error instance, only message, name, and stack will be included —
additional fields will no longer pollute the logs.

---------

Co-authored-by: Rudolf Meijering <skaapgif@gmail.com>
(cherry picked from commit 0a29908)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 28, 2025
…ON layout (elastic#244364)

## Summary

In this PR, we serialize meta.error to only keep the relevant attributes
(message, name, stack) if it is an instance of Error.

## Release note

Fixes serialization of meta.error in JSON layouts: if the error is an
Error instance, only message, name, and stack will be included —
additional fields will no longer pollute the logs.

---------

Co-authored-by: Rudolf Meijering <skaapgif@gmail.com>
(cherry picked from commit 0a29908)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.19
9.1
9.2

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Nov 28, 2025
… in JSON layout (#244364) (#244660)

# Backport

This will backport the following commits from `main` to `9.1`:
- [[Error logs] Serialize meta.error if it is an instance of Error in
JSON layout (#244364)](#244364)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Maryam
Saeidi","email":"maryam.saeidi@elastic.co"},"sourceCommit":{"committedDate":"2025-11-28T14:37:58Z","message":"[Error
logs] Serialize meta.error if it is an instance of Error in JSON layout
(#244364)\n\n## Summary\n\nIn this PR, we serialize meta.error to only
keep the relevant attributes\n(message, name, stack) if it is an
instance of Error.\n\n## Release note\n\nFixes serialization of
meta.error in JSON layouts: if the error is an\nError instance, only
message, name, and stack will be included —\nadditional fields will no
longer pollute the logs.\n\n---------\n\nCo-authored-by: Rudolf
Meijering
<skaapgif@gmail.com>","sha":"0a29908b868014c88f269dc94adee7fdea5d1232","branchLabelMapping":{"^v9.3.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","backport:all-open","v9.3.0"],"title":"[Error
logs] Serialize meta.error if it is an instance of Error in JSON
layout","number":244364,"url":"https://github.com/elastic/kibana/pull/244364","mergeCommit":{"message":"[Error
logs] Serialize meta.error if it is an instance of Error in JSON layout
(#244364)\n\n## Summary\n\nIn this PR, we serialize meta.error to only
keep the relevant attributes\n(message, name, stack) if it is an
instance of Error.\n\n## Release note\n\nFixes serialization of
meta.error in JSON layouts: if the error is an\nError instance, only
message, name, and stack will be included —\nadditional fields will no
longer pollute the logs.\n\n---------\n\nCo-authored-by: Rudolf
Meijering
<skaapgif@gmail.com>","sha":"0a29908b868014c88f269dc94adee7fdea5d1232"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.3.0","branchLabelMappingKey":"^v9.3.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/244364","number":244364,"mergeCommit":{"message":"[Error
logs] Serialize meta.error if it is an instance of Error in JSON layout
(#244364)\n\n## Summary\n\nIn this PR, we serialize meta.error to only
keep the relevant attributes\n(message, name, stack) if it is an
instance of Error.\n\n## Release note\n\nFixes serialization of
meta.error in JSON layouts: if the error is an\nError instance, only
message, name, and stack will be included —\nadditional fields will no
longer pollute the logs.\n\n---------\n\nCo-authored-by: Rudolf
Meijering
<skaapgif@gmail.com>","sha":"0a29908b868014c88f269dc94adee7fdea5d1232"}}]}]
BACKPORT-->

Co-authored-by: Maryam Saeidi <maryam.saeidi@elastic.co>
Co-authored-by: Rudolf Meijering <skaapgif@gmail.com>
kibanamachine added a commit that referenced this pull request Nov 28, 2025
… in JSON layout (#244364) (#244661)

# Backport

This will backport the following commits from `main` to `9.2`:
- [[Error logs] Serialize meta.error if it is an instance of Error in
JSON layout (#244364)](#244364)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Maryam
Saeidi","email":"maryam.saeidi@elastic.co"},"sourceCommit":{"committedDate":"2025-11-28T14:37:58Z","message":"[Error
logs] Serialize meta.error if it is an instance of Error in JSON layout
(#244364)\n\n## Summary\n\nIn this PR, we serialize meta.error to only
keep the relevant attributes\n(message, name, stack) if it is an
instance of Error.\n\n## Release note\n\nFixes serialization of
meta.error in JSON layouts: if the error is an\nError instance, only
message, name, and stack will be included —\nadditional fields will no
longer pollute the logs.\n\n---------\n\nCo-authored-by: Rudolf
Meijering
<skaapgif@gmail.com>","sha":"0a29908b868014c88f269dc94adee7fdea5d1232","branchLabelMapping":{"^v9.3.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","backport:all-open","v9.3.0"],"title":"[Error
logs] Serialize meta.error if it is an instance of Error in JSON
layout","number":244364,"url":"https://github.com/elastic/kibana/pull/244364","mergeCommit":{"message":"[Error
logs] Serialize meta.error if it is an instance of Error in JSON layout
(#244364)\n\n## Summary\n\nIn this PR, we serialize meta.error to only
keep the relevant attributes\n(message, name, stack) if it is an
instance of Error.\n\n## Release note\n\nFixes serialization of
meta.error in JSON layouts: if the error is an\nError instance, only
message, name, and stack will be included —\nadditional fields will no
longer pollute the logs.\n\n---------\n\nCo-authored-by: Rudolf
Meijering
<skaapgif@gmail.com>","sha":"0a29908b868014c88f269dc94adee7fdea5d1232"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.3.0","branchLabelMappingKey":"^v9.3.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/244364","number":244364,"mergeCommit":{"message":"[Error
logs] Serialize meta.error if it is an instance of Error in JSON layout
(#244364)\n\n## Summary\n\nIn this PR, we serialize meta.error to only
keep the relevant attributes\n(message, name, stack) if it is an
instance of Error.\n\n## Release note\n\nFixes serialization of
meta.error in JSON layouts: if the error is an\nError instance, only
message, name, and stack will be included —\nadditional fields will no
longer pollute the logs.\n\n---------\n\nCo-authored-by: Rudolf
Meijering
<skaapgif@gmail.com>","sha":"0a29908b868014c88f269dc94adee7fdea5d1232"}}]}]
BACKPORT-->

Co-authored-by: Maryam Saeidi <maryam.saeidi@elastic.co>
Co-authored-by: Rudolf Meijering <skaapgif@gmail.com>
kibanamachine added a commit that referenced this pull request Nov 30, 2025
…r in JSON layout (#244364) (#244659)

# Backport

This will backport the following commits from `main` to `8.19`:
- [[Error logs] Serialize meta.error if it is an instance of Error in
JSON layout (#244364)](#244364)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Maryam
Saeidi","email":"maryam.saeidi@elastic.co"},"sourceCommit":{"committedDate":"2025-11-28T14:37:58Z","message":"[Error
logs] Serialize meta.error if it is an instance of Error in JSON layout
(#244364)\n\n## Summary\n\nIn this PR, we serialize meta.error to only
keep the relevant attributes\n(message, name, stack) if it is an
instance of Error.\n\n## Release note\n\nFixes serialization of
meta.error in JSON layouts: if the error is an\nError instance, only
message, name, and stack will be included —\nadditional fields will no
longer pollute the logs.\n\n---------\n\nCo-authored-by: Rudolf
Meijering
<skaapgif@gmail.com>","sha":"0a29908b868014c88f269dc94adee7fdea5d1232","branchLabelMapping":{"^v9.3.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","backport:all-open","v9.3.0"],"title":"[Error
logs] Serialize meta.error if it is an instance of Error in JSON
layout","number":244364,"url":"https://github.com/elastic/kibana/pull/244364","mergeCommit":{"message":"[Error
logs] Serialize meta.error if it is an instance of Error in JSON layout
(#244364)\n\n## Summary\n\nIn this PR, we serialize meta.error to only
keep the relevant attributes\n(message, name, stack) if it is an
instance of Error.\n\n## Release note\n\nFixes serialization of
meta.error in JSON layouts: if the error is an\nError instance, only
message, name, and stack will be included —\nadditional fields will no
longer pollute the logs.\n\n---------\n\nCo-authored-by: Rudolf
Meijering
<skaapgif@gmail.com>","sha":"0a29908b868014c88f269dc94adee7fdea5d1232"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.3.0","branchLabelMappingKey":"^v9.3.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/244364","number":244364,"mergeCommit":{"message":"[Error
logs] Serialize meta.error if it is an instance of Error in JSON layout
(#244364)\n\n## Summary\n\nIn this PR, we serialize meta.error to only
keep the relevant attributes\n(message, name, stack) if it is an
instance of Error.\n\n## Release note\n\nFixes serialization of
meta.error in JSON layouts: if the error is an\nError instance, only
message, name, and stack will be included —\nadditional fields will no
longer pollute the logs.\n\n---------\n\nCo-authored-by: Rudolf
Meijering
<skaapgif@gmail.com>","sha":"0a29908b868014c88f269dc94adee7fdea5d1232"}}]}]
BACKPORT-->

Co-authored-by: Maryam Saeidi <maryam.saeidi@elastic.co>
Co-authored-by: Rudolf Meijering <skaapgif@gmail.com>
tkajtoch pushed a commit to tkajtoch/kibana that referenced this pull request Dec 1, 2025
…ON layout (elastic#244364)

## Summary

In this PR, we serialize meta.error to only keep the relevant attributes
(message, name, stack) if it is an instance of Error.

## Release note

Fixes serialization of meta.error in JSON layouts: if the error is an
Error instance, only message, name, and stack will be included —
additional fields will no longer pollute the logs.

---------

Co-authored-by: Rudolf Meijering <skaapgif@gmail.com>
@maryam-saeidi maryam-saeidi deleted the serialize-meta-error branch December 2, 2025 21:09
NicholasPeretti pushed a commit to NicholasPeretti/kibana that referenced this pull request Dec 2, 2025
…ON layout (elastic#244364)

## Summary

In this PR, we serialize meta.error to only keep the relevant attributes
(message, name, stack) if it is an instance of Error.

## Release note

Fixes serialization of meta.error in JSON layouts: if the error is an
Error instance, only message, name, and stack will be included —
additional fields will no longer pollute the logs.

---------

Co-authored-by: Rudolf Meijering <skaapgif@gmail.com>
JordanSh pushed a commit to JordanSh/kibana that referenced this pull request Dec 9, 2025
…ON layout (elastic#244364)

## Summary

In this PR, we serialize meta.error to only keep the relevant attributes
(message, name, stack) if it is an instance of Error.

## Release note

Fixes serialization of meta.error in JSON layouts: if the error is an
Error instance, only message, name, and stack will be included —
additional fields will no longer pollute the logs.

---------

Co-authored-by: Rudolf Meijering <skaapgif@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:all-open Backport to all branches that could still receive a release release_note:fix v8.19.9 v9.1.9 v9.2.3 v9.3.0

6 participants