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

[test] Surfacing deprecations with rich context from ES warning header #120109

Closed
wants to merge 12 commits into from

Conversation

rudolf
Copy link
Contributor

@rudolf rudolf commented Dec 1, 2021

Summary

Backport #120044 on 7.16 since I couldn't see any deprecation logs on main to verify that it works.

Checklist

Delete any items that are not applicable to this PR.

Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.

When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:

Risk Probability Severity Mitigation/Notes
Multiple Spaces—unexpected behavior in non-default Kibana Space. Low High Integration tests will verify that all features are still supported in non-default Kibana Space and when user switches between spaces.
Multiple nodes—Elasticsearch polling might have race conditions when multiple Kibana nodes are polling for the same tasks. High Low Tasks are idempotent, so executing them multiple times will not result in logical error, but will degrade performance. To test for this case we add plenty of unit tests around this logic and document manual testing procedure.
Code should gracefully handle cases when feature X or plugin Y are disabled. Medium High Unit tests will verify that any feature flag or plugin combination still results in our service operational.
See more potential risk examples

For maintainers

@rudolf rudolf added the Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc label Dec 1, 2021
@rudolf rudolf changed the title 16Es log deprecations 716 [7.16] Surfacing deprecations with rich context from ES warning header Dec 1, 2021
@rudolf rudolf force-pushed the es-log-deprecations-716 branch from e3c7ae9 to 270ed4e Compare December 1, 2021 14:47
@rudolf rudolf force-pushed the es-log-deprecations-716 branch from 9885fbb to 3d793d7 Compare December 2, 2021 09:56
@juliaElastic
Copy link
Contributor

@rudolf is this intended to be merged? I would like to see if any deprecation stacktraces are coming from fleet plugin.
should I take this pr and run locally?
I checked the CI logs on this pr, but didn't see deprecation logs.

@rudolf rudolf force-pushed the es-log-deprecations-716 branch from add8b9d to 45ecde2 Compare December 2, 2021 16:09
@rudolf rudolf force-pushed the es-log-deprecations-716 branch from 2b6c7e0 to 5374ac7 Compare December 2, 2021 17:41
const txt = format(msg.args[0], ...msg.args.slice(1));
// Ensure that Elasticsearch deprecation log messages from Kibana aren't ignored
if (/\[deprecation\]\[elasticsearch\]/.test(txt)) {
return true;
Copy link
Contributor

Choose a reason for hiding this comment

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

Returning true here isn't enough, it needs to get to the ToolingLogTextWriter.write() call below for true to actually mean "I wrote the message"

@kibana-ci
Copy link
Collaborator

kibana-ci commented Dec 3, 2021

💔 Build Failed

Failed CI Steps

Test Failures

  • [job] [logs] Jest Tests #3 / schema creates correct schema with defaults.
  • [job] [logs] Jest Tests #3 / configureClient Client logging deprecation warnings from response headers does not log when no deprecation warning header is returned
  • [job] [logs] Jest Tests #3 / configureClient Client logging deprecation warnings from response headers logs error when the client receives an Elasticsearch error response for a deprecated request originating from a user
  • [job] [logs] Jest Tests #3 / configureClient Client logging deprecation warnings from response headers logs error when the client receives an Elasticsearch success response for a deprecated request originating from a user
  • [job] [logs] Jest Tests #3 / configureClient Client logging deprecation warnings from response headers logs warning when the client receives an Elasticsearch error response for a deprecated request originating from kibana
  • [job] [logs] Jest Tests #3 / configureClient Client logging deprecation warnings from response headers logs warning when the client receives an Elasticsearch success response for a deprecated request originating from kibana
  • [job] [logs] Jest Tests #3 / CoreUsageDataService start getCoreUsageData elasticsearch.principal returns expected usage data for elastic.username "elastic"
  • [job] [logs] Jest Tests #3 / correctly fills in default loggers config.
  • [job] [logs] Jest Integration Tests / migration v2 logs a warning and completes the migration with unknown docs retained

Metrics [docs]

✅ unchanged

History

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

@rudolf rudolf changed the title [7.16] Surfacing deprecations with rich context from ES warning header [test] Surfacing deprecations with rich context from ES warning header Jan 5, 2022
@rudolf
Copy link
Contributor Author

rudolf commented Jan 5, 2022

This work has been backported to 7.16 in #120882

@rudolf rudolf closed this Jan 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants