st2
st2 copied to clipboard
Is it possible to disable history for certain actions?
Is it possible to disable history for certain actions? Or keep only the newest 10 executions?
You could craft a script that would do this against Mongo and put it on a cron timer - but the garbage collector, when configured, doesn't operate exclusively against an action name.
I guess what you're looking to do is define different retention policies for actions? E.g. 'keep, discard, discard after
@LindsayHill Yes, exactly!
Looks like you could start by using st2-purge-executions
with --action-ref
parameter, to delete executions for a specific action. Combine that with cron + the timestamp option, and you can do most of what you want today.
Don't know of any short-term plans to either add 'action-ref' matching capabilities to the st2garbagecollector, or to set retention policies on a per-action basis. Suspect that would be pretty complicated to do technically. Happy to look at PRs though.
I'm having a similar question. I created an action to post a pubsub topic on completion of some actions. I tried both core.st2.generic.actiontrigger and core.st2.generic.notifyrigger. For core.st2.generic.actiontrigger, the problem is every completed action is companioned with a topic posting action in the action history. For core.st2.generic.notifyrigger, the situation is better, but still, every action with notify section in the definition is companioned with a topic posting action in the action history. Is there a configuration to disable the history records of the topic posting action?