-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
[FEATURE REQUEST] Orchestration job metadata #62683
Comments
@garethgreenaway Are there any chances to see this feature implemented in the near future (maybe after the 3006 is released)? We have some ideas on how to use it Salt Grafana https://turtletraction-oss.gitlab.io/salt-grafana/ |
@max-arnold Thanks for the reminder. Seems like a good thing to plan for 3007. |
Ping |
@garethgreenaway Hey! Hope you are well It looks like I have to roll up my sleeves and try to implement this feature on my own. Would you be kind enough to show some pointers in the code? I do not need any help with the trivial stuff like CLI options, but some pointers in the codebase where it is best to pass this metadata context can be very helpful:
UPD for (3): found at least one convoluted way to spawn a runner sub-job that is not orchestration:
It produces two job returns:
|
Is your feature request related to a problem? Please describe.
For reporting/observability purposes it would be very useful to add custom metadata (key/value pairs) to Salt jobs. This metadata should be propagated back to job returns (be visible on the event bus) and could be used to track and filter particular job types using this metadata.
Turns out, this feature already exists in Salt:
Unfortunately,
salt-run
doesn't have an ability to add metadata and it is not possible to pass metadata from an orchestration job to any child jobs that generate new JIDs and produce separate returnsDescribe the solution you'd like
My suggestion is to add the job metadata to runner jobs to achieve feature parity with other job types (salt, salt-call, scheduled):
salt-run
: either named--metadata
(used bysalt
) or--set-metadata
(used bysalt-call
, because--metadata
does another thing, see Add --set-metadata option to salt-call #37362salt.function
,salt.state
,salt.runner
,salt.parallel_runners
,salt.wheel
, including nested orchestrations).The return event from the
Sleep
sub-job should have{foo: bar, baz: qux}
metadata, the return from the orch itself just{foo: bar
}I believe this ability to add cross-cutting job metadata will significantly improve job traceability for complex orchestrations that spawn new sub-jobs.
Describe alternatives you've considered
An alternative is to add a parent job ID to every sub-job spawned by the orchestration. It is less flexible though because it is a single field and doesn't allow adding arbitrary attributes.
P.S. check whether it is possible to supply metadata via salt-api.
P.P.S. maybe also worth passing it down to jinja context for a complete pass-through observability
The text was updated successfully, but these errors were encountered: