-
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
adds apm instrumentation to task manager's task runner #55356
Conversation
const trans = apm.startTransaction( | ||
`taskManager run ${this.instance.taskType}`, | ||
'taskManager', | ||
this.instance.taskType, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name
and type
(first two parms ^^^) of apm.startTransaction()
seem useful, in terms of how the UI ends up making use of them. The subtype
and action
(last two parms) I'm less sure of, as I'm not sure they come up directly in the UI. Since these end up being other plugins tasks running, seems unlikely we can consistently get more specific per-task info. And alerting and actions already have alertType and actionType specific task types, which makes for nice grouping.
Thinking of just removing the last two.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
return this.processResult(validatedResult); | ||
} catch (err) { | ||
this.logger.error(`Task ${this} failed: ${err}`); | ||
// in error scenario, we can not get the RunResult | ||
// re-use modifiedContext's state, which is correct as of beforeRun | ||
if (trans) trans.end(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably want to use trans.end('success')
and one for failure as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
@@ -252,6 +253,7 @@ export class TaskStore { | |||
) | |||
); | |||
|
|||
const trans = apm.startTransaction(`taskManager markAvailableTasksAsClaimed`, 'taskManager'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think for this call, we should look into using transaction.setLabel()
to add the queue size. Hopefully it will show up somewhere in the UI, but ideally I'd like some sort of specialzed ui for this anyway, so while it may not be immediately useful, at least it's getting written somewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
label values must be strings, so not as useful as I thought
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, we'd need to actually get the queue size, but I wouldn't want the cost of getting that to be included here, so we'll have to figure out some other story for the queue size ...
Adds some apm transaction boundaries for parts of task manager, so that they will show up in APM as new types of transactions. Should provide some visibility into the ES calls made by task manager for alerting and actions, especially under stress testing scenarios.
bd09593
to
76451dd
Compare
Pinging @elastic/kibana-alerting-services (Team:Alerting Services) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is super exciting to see!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@elasticmachine merge upstream |
💛 Build succeeded, but was flaky
Test FailuresKibana Pipeline / kibana-xpack-agent / Chrome X-Pack UI Functional Tests.x-pack/test/functional/apps/advanced_settings/feature_controls/advanced_settings_spaces·ts.Advanced Settings spaces feature controls space with Advanced Settings disabled redirects to management homeStandard Out
Stack Trace
History
To update your PR or re-run it, just comment with: |
Adds some apm transaction boundaries for parts of task manager, so that they will show up in APM as new types of transactions. Should provide some visibility into the ES calls made by task manager for alerting and actions, especially under stress testing scenarios.
Adds some apm transaction boundaries for parts of task manager, so that they will show up in APM as new types of transactions. Should provide some visibility into the ES calls made by task manager for alerting and actions, especially under stress testing scenarios.
* master: [Canvas] Move sample data and feature registration to canvas np plugin (elastic#56564) instrument task manager with apm transactions (elastic#55356) displays Alert Instance state on Alert Details page (elastic#56842) Adding the Accessibility Statement to docs (elastic#57153) [Uptime] Remove redundant adapter function (elastic#56980) [SIEM][Detection Engine] Backend end-to-end tests [Uptime] Added tests for pages (elastic#56736) Updating to kind-of@6.0.3 (elastic#57367)
Summary
This adds APM support to task manager by instrumenting task manager's task runner with apm transactions.
To use in Kibana with
yarn start
, create a fileconfig/apm.dev.js
with the following contents:You'll then need an APM server running. For running Kibana off master, I was able to run a production cloud 7.5.1 deployment, with apm enabled (the default), and use the token and url provided by the deployment. Start your local Kibana via
yarn start
, and you'll start seeing numbers in your APM instance.Here's an example of what a pretty simple instrumentation (the first commit) can provide: