Closed fearful-symmetry closed 1 year ago
cc @fearful-symmetry
the below badges are clickable and redirect to their specific view in the CI or DOCS
#### Build stats * Start Time: 2023-07-19T16:29:05.343+0000 * Duration: 4 min 3 sec
To re-run your PR in the CI, just comment with: - `/test` : Re-trigger the build.
Part of https://github.com/elastic/elastic-agent/issues/2141 and https://github.com/elastic/elastic-agent/issues/2140
This PR contains a few changes:
level
field to theActionRequest
message type that tags the action as acting on either a unit or the whole component. This contains three level types, with the first beingALL
in order to make sure that older non-compatible clients will behave in the expected way. Right now, only diagnostics care about this field.tryPerformDiagnostics
to support thelevel
field; diagnostics that are registered at the client-level become associated with thecomponent
level, and diagnostics registered with a unit become associated with theunit
level.RegisterOptionalDiagnosticHook()
. These optional diagnostics are triggered by corresponding tag in theparams
field of theActionRequest
message.DiagnosticParams
that allows the diagnostic actions to take advantage of theparams
field in a standardized way.Additional things to consider:
DiagnosticParams
in additional ways while we're here; there's easily a few forward-looking field we could add, but right now this was strictly focused on supporting optional CPU profiling.ActionRequest
changes with the goal of making changes both non-breaking and relatively consistent with other parts of the API, but I'm not particularly happy with stuff likeIf level=component, then the consumer should ignore the unit_id and unit_type fields
. My other idea was to break apart theActionRequest
message into different types entirely, perhaps with a different API request for diagnostics, as opposed to the currently strategy of using a single API call for actions and diagnostics. That, however, would be a much larger change.