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

Log deprecations originating from Kibana on debug level #123660

Merged
merged 3 commits into from
Jan 25, 2022

Conversation

rudolf
Copy link
Contributor

@rudolf rudolf commented Jan 24, 2022

Summary

In #120044 Kibana started logging when Elasticsearch requests returned the deprecation header. For requests with the x-elastic-product-origin: kibana header we logged on the info level. Since our thinking was to remove all usages of deprecated API's this wouldn't produce a lot of log volume.

However, most teams didn't remove usage of deprecated API's and some deprecation logs cannot be avoided such as elastic/elasticsearch#81589 elastic/elasticsearch#81480 elastic/elasticsearch#81345

So to avoid confusion and a lot of log noise for our users it's better to log these messages on the debug level.

Risks

The only change to non-test code is a single line to change the log level 98c7892 so the risk of this affecting users is very small.

We could however risk that deprecations are no longer correctly showing up in CI runs. To mitigate this I'll verify the amount of surfaced deprecation logs with this PR against previous 7.17 builds.

For maintainers

@rudolf rudolf added v7.17.0 bug Fixes for quality problems that affect the customer experience Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc labels Jan 24, 2022
loggers: [
{
name: 'root',
level: 'error',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

before jest integration tests wouldn't log anything to the console, but having at least error logs is useful for failing/flaky tests

@rudolf rudolf force-pushed the debug-deprecation-logs branch from c2a4f99 to 462e093 Compare January 24, 2022 21:25
@rudolf rudolf marked this pull request as ready for review January 24, 2022 21:27
@rudolf rudolf requested a review from a team as a code owner January 24, 2022 21:27
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-core (Team:Core)

Comment on lines 143 to 147
if (requestOrigin === 'kibana') {
deprecationLogger.info(deprecationMsg);
deprecationLogger.debug(deprecationMsg);
} else {
deprecationLogger.debug(deprecationMsg);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

NIT: given that's now the same level, should we just remove this if/else block?

Comment on lines +125 to +126
deprecation: { type: 'console', layout: { type: 'json' } },
console: { type: 'console', layout: { type: 'pattern' } },
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't it going to be an issue to have both json and pattern messages output on stdout?

@pgayvallet pgayvallet added the release_note:skip Skip the PR/issue when compiling release notes label Jan 24, 2022
@rudolf rudolf enabled auto-merge (squash) January 25, 2022 10:19
@rudolf rudolf added the auto-backport Deprecated - use backport:version if exact versions are needed label Jan 25, 2022
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

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

@rudolf rudolf merged commit c64c766 into elastic:main Jan 25, 2022
@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
7.17 Backport failed because of merge conflicts

How to fix

Re-run the backport manually:

node scripts/backport --pr 123660

Questions ?

Please refer to the Backport tool documentation

@rudolf rudolf deleted the debug-deprecation-logs branch January 25, 2022 12:07
rudolf added a commit that referenced this pull request Jan 25, 2022
* Log deprecations originating from Kibana on debug level

* Surface debug level deprecation logs on CI

* Review feedback

(cherry picked from commit c64c766)
rudolf added a commit that referenced this pull request Jan 25, 2022
…23711)

* Log deprecations originating from Kibana on debug level

* Surface debug level deprecation logs on CI

* Review feedback

(cherry picked from commit c64c766)
@rudolf rudolf added the v8.0.0 label Jan 26, 2022
rudolf added a commit to rudolf/kibana that referenced this pull request Jan 26, 2022
* Log deprecations originating from Kibana on debug level

* Surface debug level deprecation logs on CI

* Review feedback

(cherry picked from commit c64c766)
rudolf added a commit that referenced this pull request Jan 26, 2022
…23799)

* Log deprecations originating from Kibana on debug level

* Surface debug level deprecation logs on CI

* Review feedback

(cherry picked from commit c64c766)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed bug Fixes for quality problems that affect the customer experience release_note:skip Skip the PR/issue when compiling release notes Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc v7.17.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants