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

Add execution context to log records #60122

Open
joshdover opened this issue Mar 13, 2020 · 6 comments
Open

Add execution context to log records #60122

joshdover opened this issue Mar 13, 2020 · 6 comments
Labels
enhancement New value added to drive a business result Feature:Logging Feature:New Platform NeededFor:Security Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc

Comments

@joshdover
Copy link
Contributor

In order to support enhanced observability of Kibana itself, we should add a richer "execution context" to the New Platform's logging service that allows correlation between different log records that occur during an "execution context" such as a request or background task.

This context should automatically be attached to any log records produced during an execution context, ideally by leveraging the RequestHandlerContext pattern.

Fields that should be part of this context:

  • A unique identifier for the execution context, such as the X-Opaque-Id header

Plugins should be able to leverage this identifier to find other useful information about these log events, such as the current user.

Related issue: #52125

@joshdover joshdover added Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc Feature:New Platform enhancement New value added to drive a business result labels Mar 13, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-platform (Team:Platform)

@pgayvallet
Copy link
Contributor

Do we have an idea how we would 'bind' the logger's records to the request execution context in a node environment without tools such as Java's threadlocal ?

@mshustov mshustov mentioned this issue Mar 19, 2020
30 tasks
@joshdover joshdover moved this from 7.8 to 7.9 - Tentative in kibana-core [DEPRECATED] Mar 31, 2020
@joshdover joshdover moved this from 7.9 - Tentative to 7.10 (tentative) in kibana-core [DEPRECATED] Apr 22, 2020
@joshdover joshdover moved this from 7.10 - Tentative to 7.9 in kibana-core [DEPRECATED] May 28, 2020
@joshdover joshdover assigned joshdover and unassigned mshustov May 28, 2020
@joshdover joshdover moved this from 7.9 to In Progress in kibana-core [DEPRECATED] Jul 15, 2020
@joshdover
Copy link
Contributor Author

@thomheymann is this a blocker for security anymore? As I understand it, this only affects regular log messages and should not affect the audit trail logs at all.

While I agree that adding the request ID to regular logs is very useful, I think we are fine if we delay this past 7.10.

@mshustov mshustov moved this from In Progress to 7.11 in kibana-core [DEPRECATED] Nov 3, 2020
@joshdover joshdover moved this from 7.11 to In Progress in kibana-core [DEPRECATED] Dec 2, 2020
@joshdover joshdover moved this from In Progress to 7.14 - Tentative in kibana-core [DEPRECATED] Dec 2, 2020
@joshdover joshdover moved this from 7.14 - Tentative to Prioritized Backlog in kibana-core [DEPRECATED] Dec 2, 2020
@joshdover joshdover removed their assignment Dec 2, 2020
@pgayvallet
Copy link
Contributor

@elastic/kibana-security do you knoe if that is still a requierement on your side?

@legrego
Copy link
Member

legrego commented Jul 8, 2024

@elastic/kibana-security do you knoe if that is still a requierement on your side?

@pgayvallet I'm not sure what the original goal was. Our audit logs already include a trace id to understand everything that happens within the context of a specific KibanaRequest.

If we're looking for something that spans multiple requests (such as the loading of a dashboard), then we don't have a mechanism for that, yet. I think this would be a welcome addition to our audit events, but this isn't something we are currently prioritizing.

@pgayvallet
Copy link
Contributor

I'm not sure what the original goal was. Our audit logs already include a trace id to understand everything that happens within the context of a specific KibanaRequest.

The idea is to be able to attach a traceId to all our log entries, so that we can track execution of a specific request more easily (so basically what you did for audit logging, but for all our logging system). This is similar to log4js' MDC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New value added to drive a business result Feature:Logging Feature:New Platform NeededFor:Security Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
Projects
kibana-core [DEPRECATED]
Enhancement Backlog
Development

No branches or pull requests

5 participants