sentry-github-actions-app icon indicating copy to clipboard operation
sentry-github-actions-app copied to clipboard

Filter out some workflows/jobs

Open fbarbare opened this issue 5 months ago • 0 comments

This integartion sends quite a lot of spans to Sentry and we would like to reduce it to not go over the quota that we're paying for. In order to do that, we would like to disable this integration for some of the workflows/jobs that we have since they are not critical and quite basic. Some only run for a few seconds.

I think we could include some configuration in the sentry_config.ini so that we can include/exclude some workflows.

I was thinking that we could have a structure that would look like this in JSON:

{
  "dsn": "https://[email protected]/foobar",
  "include_workflows": [
    {"repo": "repo-1", "workflow": "workflow1.yml"},
    {"repo": "repo-2", "workflow": "workflow1.yml"}
  ],
  "exclude_workflows": [
    {"repo": "repo-1", "workflow": "workflow2.yml"},
    {"repo": "repo-2", "workflow": "workflow2.yml"}
  ]
}

which seem to look like this in .ini file (might be wrong, I don't know much about those):

dsn=https://[email protected]/foobar
include_workflows[]={"repo":"repo-1","workflow":"workflow1.yml"}
include_workflows[]={"repo":"repo-2","workflow":"workflow1.yml"}
exclude_workflows[]={"repo":"repo-1","workflow":"workflow2.yml"}
exclude_workflows[]={"repo":"repo-2","workflow":"workflow2.yml"}

I could work on something like that and submit a PR. What are your thoughts?

fbarbare avatar Sep 03 '24 10:09 fbarbare