jenkinsci / datadog-plugin

A Jenkins plugin used to forward metrics, events, and service checks to an account at Datadog, automatically.
https://plugins.jenkins.io/datadog/
MIT License
30 stars 48 forks source link

Add ability to granualarly filter events #364

Closed sarah-witt closed 10 months ago

sarah-witt commented 1 year ago

What does this PR do?

continuing https://github.com/jenkinsci/datadog-plugin/pull/353 to support filtering events by event name in addition to filtering by category

Description of the Change

Alternate Designs

Possible Drawbacks

Verification Process

Additional Notes

Release Notes

Review checklist (to be filled by reviewers)

NouemanKHAL commented 1 year ago

Looks good overall! small nit: it would be good to have add a sort of eventName attribute to the classes in order to have something like DatadogUtilities.shouldSendEvent(this.eventName).

sarah-witt commented 1 year ago

small nit: it would be good to have add a sort of eventName attribute to the classes in order to have something like DatadogUtilities.shouldSendEvent(this.eventName).

@NouemanKHAL Good point, we thought about this but then decided it was better to be able to check the event name before creating the event. What do you think of creating static variable for event name in the classes and that way we can still have the property tied to the class but not need to create an instance first? Also while investigating this I found a bug with the shouldSendEvent logic so I fixed that!

NouemanKHAL commented 1 year ago

@sarah-witt Great! And yes making it static would be perfect 👌