getsentry / sentry-kubernetes

Kubernetes event reporter for Sentry
Apache License 2.0
458 stars 64 forks source link

Option to add custom tags like pod.Labels, Option to set SampleRate and set Event Message #85

Open rajesh-dhakad opened 8 months ago

rajesh-dhakad commented 8 months ago

Option to add custom tags like pod.Labels: We make use of labels to identify resources belonging to applications and/or teams. It would be really useful to have those as tags in sentry to filter by them. So I would propose adding labels as tags.

Option to set SampleRate: We should have option to specify SampleRate.

Option to set Event Message: This helps in grouping.

To fulfil my requirements i made changes by forking this repo: https://github.com/getsentry/sentry-kubernetes/compare/master...rajesh-dhakad:sentry-kubernetes:master

But if we can include this in parent repo would be great help.

tonyo commented 7 months ago

Thanks for the suggestions!

Option to set SampleRate: We should have option to specify SampleRate.

Making the sample rate configurable (via an environment variable) sounds good, a PR with the change would be welcome 👍

Option to add custom tags like pod.Labels

We could probably expose all pod (and other resources') labels as tags by default, but there might be some caveats with that (e.g. making sure that label names and values are properly mapped to Sentry tags). I'd suggest to have an opt-in environment variable flag: if enabled, we add a Sentry tag for each label on the resource. And then if everything works fine and stable, we can make it a default (and/or opt-out) behavior. How does that sound?

Option to set Event Message: This helps in grouping

You mean the part with extracting "app.kubernetes.io/name" label, and then using it instead of the pod name? Here I feel like we'll need a more generic/flexible solution. Could you provide more info on your use case? I wonder if can be solved with some of the ideas we at Sentry had in mind for the future.