In PR https://github.com/elastic/kibana/pull/108197, support was added to alerting and task manager to set the "executionContext", so that calls to ES will be sent with a header indicating the source of the ES call (task, alerting rule, etc).
Realized after the merge, that "alert" leaked through 🤦🏻.
I also thought we might want to tweak the strings that are being used anyway. We should check how they are appearing in ES logs I guess, make sure they make sense.
Additionally - could be split into a separate PR - connectors have not be instrumented like this, but should be. Presumably they would only augment the index connector, so I'm guessing these would be easy to identify from ES logs anyway. So I don't think there's a lot of urgency for that.
Relates to https://github.com/elastic/kibana/issues/90375.
In PR https://github.com/elastic/kibana/pull/108197, support was added to alerting and task manager to set the "executionContext", so that calls to ES will be sent with a header indicating the source of the ES call (task, alerting rule, etc).
Realized after the merge, that "alert" leaked through 🤦🏻.
I also thought we might want to tweak the strings that are being used anyway. We should check how they are appearing in ES logs I guess, make sure they make sense.
Additionally - could be split into a separate PR - connectors have not be instrumented like this, but should be. Presumably they would only augment the index connector, so I'm guessing these would be easy to identify from ES logs anyway. So I don't think there's a lot of urgency for that.
Here are where the strings are currently set:
https://github.com/elastic/kibana/blob/36bba6ffe0aa4ab532ed857946205ee98ba2d5a4/x-pack/plugins/task_manager/server/task_running/task_runner.ts#L272-L277
https://github.com/elastic/kibana/blob/36bba6ffe0aa4ab532ed857946205ee98ba2d5a4/x-pack/plugins/task_manager/server/task_running/ephemeral_task_runner.ts#L200-L205
https://github.com/elastic/kibana/blob/36bba6ffe0aa4ab532ed857946205ee98ba2d5a4/x-pack/plugins/alerting/server/task_runner/task_runner.ts#L265-L272