st2 icon indicating copy to clipboard operation
st2 copied to clipboard

Is it possible to disable history for certain actions?

Open pietervogelaar opened this issue 7 years ago • 5 comments

Is it possible to disable history for certain actions? Or keep only the newest 10 executions?

pietervogelaar avatar Jun 26 '17 14:06 pietervogelaar

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.

bigmstone avatar Jun 26 '17 21:06 bigmstone

I guess what you're looking to do is define different retention policies for actions? E.g. 'keep, discard, discard after '?

LindsayHill avatar Jun 29 '17 02:06 LindsayHill

@LindsayHill Yes, exactly!

pietervogelaar avatar Jun 29 '17 07:06 pietervogelaar

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.

LindsayHill avatar Jul 05 '17 22:07 LindsayHill

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?

hsheng avatar Jun 15 '23 22:06 hsheng