-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Include the calling plugin ID in a request header on all Elasticsearch API calls #77214
Comments
Pinging @elastic/kibana-platform (Team:Platform) |
Pinging @elastic/kibana-telemetry (Team:KibanaTelemetry) |
@polyfractal Do you have an input on the header name here? This is something we should be able to easily add whenever Elasticsearch is ready for it. |
Thanks for opening this @joshdover! Lemme touch base with a few other ES folks to make sure we're all on the same page regarding this change, since it will affect a few different teams. Will be back when I have more info :) |
Sorry I thought I had posted this comment but apparently never hit the button 🤦 Had a few conversations and the ES side is 👍 with moving forward with this. We're not quite sure when we'll get the implementation done on our side, but getting the headers in whenever Kibana has time would be good (ES will just ignore the headers until we add specific implementation for it). No strong feelings on header name, although I'm slightly partial to |
So I would personally expect something like that so others, non-kibana callers can leverage the feature:
|
That's also 100% cool with us too :) We'll take as much granularity as you'd like to provide... can always simplify on our end if it ends up being too granular, or concatenate them together for display purposes, etc. |
Note that when we call elasticsearch to query monitoring indices to send to telemetry usage data we append this header:
We've added this header long time ago in case we want to filter / track those es queries for cloud billing. Also we do pass |
Now that we're sending the |
+1 on this name. @afharo should we prioritize this for 7.14? |
I'd need to check with the ES devs. AFAIUnderstand from the description, the stats are gathered on ES, and Kibana would retrieve them somehow later on to report it. Is my understanding correct? |
Yes, I don't believe we'd need to change anything in the telemetry code for Kibana for this. The expectation is that ES can use this however they see fit to segment their usage stats that they report back to us. On the Kibana side, the only change needed would be in the ES client itself inside |
Makes sense to me. Should we prioritize based on when ES will have the bandwidth to generate stats from it? If they already have the logic in place, then +1 to tackle it asap :) |
Comment from @VijayDoshi I tend to agree that the more granular we can make it the better. |
Btw, just as a preliminary investigation: Currently, all callers (plugins and core) are using the same There is currently two ways for plugins to retrieve an elasticsearch client: Via the ES service's start contract
We will need to modify these public accessors to call the internal getter with an additional context property, that should contain at least the internal id of the plugin. We also may need to change e.g ElasticsearchServiceStart {
getClient({ caller }: { caller: string }) // would replace the static `client` property
}
// createPluginStartContext
elasticsearch: {
client: deps.elasticsearch.getClient({ caller: plugin.name }),
createClient: (type, clientConfig) => deps.elasticsearch.createClient(type, clientConfig, { caller: plugin.name })
} This would have the side effect to create a dedicated client instance for each individual plugin. As the number of plugin is constant, this is probably ok though Via
|
I'll consider this as superseded by #97934 and close it. Please feel free to reopen if I'm wrong. |
In order to assist with filtering Elasticsearch's usage telemetry, it's been requested that Kibana includes the ID of the plugin that initiated an API call in all requests sent to Elasticsearch. This will allow ES to record usage telemetry in a way that allows ES to determine the source of an API call (eg. APM vs Visualize).
The header name is TBD, but some potential options:
x-origin-application
x-origin-plugin
Ideally, this is implemented in Core and automatically configured in the ES client instances passed to plugins.
The text was updated successfully, but these errors were encountered: