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

[Custom threshold] Improve the custom threshold rule request/response logging #192443

Merged
merged 3 commits into from
Sep 12, 2024

Conversation

maryam-saeidi
Copy link
Member

@maryam-saeidi maryam-saeidi commented Sep 10, 2024

Related to #187271

Summary

As mentioned in this PR, when logging a JSON stringified string for debugging or tracing, we need to wrap it in a function. This PR does this for the custom threshold rule and removes extra request/response logging, relying on alerting framework logging for that purpose.

image

Before, we were able to have a similar log using plugins.observability and plugins.alerting.observability.rules.custom_threshold configs (as shown above), but now we only have plugins.alerting.observability.rules.custom_threshold which can be enabled by either of the following configs:

logging:
  loggers:
    - name: plugins.alerting
      level: debug
    - name: plugins.alerting.observability.rules.custom_threshold
      level: trace

Thanks @dgieselaar for bringing this to our attention!

How to test

  • Enable the trace logging config as mentioned above
  • Create a custom threshold rule and check the server logs; you should be able to see the logs for the request and response of the rule execution.

@maryam-saeidi maryam-saeidi added release_note:skip Skip the PR/issue when compiling release notes Feature: Custom threshold Observability custom threshold rule type labels Sep 10, 2024
@maryam-saeidi maryam-saeidi self-assigned this Sep 10, 2024
@maryam-saeidi maryam-saeidi requested review from a team as code owners September 10, 2024 09:08
@botelastic botelastic bot added ci:project-deploy-observability Create an Observability project Team:obs-ux-management Observability Management User Experience Team labels Sep 10, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ux-management-team (Team:obs-ux-management)

@obltmachine
Copy link

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@@ -69,9 +69,9 @@ export const checkMissingGroups = async (
];
});

logger.trace(`Request: ${JSON.stringify({ searches })}`);
logger.trace(() => `Request: ${JSON.stringify({ searches })}`);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created a ticket for improving logging msearch requests and responses: #192445

@kibana-ci
Copy link
Collaborator

kibana-ci commented Sep 10, 2024

💛 Build succeeded, but was flaky

  • Buildkite Build
  • Commit: 8c510f3
  • Kibana Serverless Image: docker.elastic.co/kibana-ci/kibana-serverless:pr-192443-8c510f362be9

Failed CI Steps

Test Failures

  • [job] [logs] Jest Tests #3 / AllCasesSelectorModal Closing modal when pressing the x icon
  • [job] [logs] FTR Configs #88 / Rules Management - Prebuilt Rules - Large Prebuilt Rules Package @ess @serverless @skipInServerlessMKI install_large_prebuilt_rules_package should install a package containing 15000 prebuilt rules without crashing

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @maryam-saeidi

Copy link
Contributor

@ymao1 ymao1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

response ops changes LGTM

Copy link
Contributor

@benakansara benakansara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@maryam-saeidi maryam-saeidi merged commit 4d5c253 into elastic:main Sep 12, 2024
43 checks passed
@maryam-saeidi maryam-saeidi deleted the improve-ct-logging branch September 12, 2024 12:57
@kibanamachine kibanamachine added v8.16.0 backport:skip This commit does not require backporting labels Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting ci:project-deploy-observability Create an Observability project Feature: Custom threshold Observability custom threshold rule type release_note:skip Skip the PR/issue when compiling release notes Team:obs-ux-management Observability Management User Experience Team v8.16.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants