Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add option for pre and post request hooks #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

abborg
Copy link

@abborg abborg commented Feb 2, 2025

Add options for pre- and post-request hooks to allow users to execute some behavior before and/or after a webhook request is made. This is to allow for observability around the requests being made as well as other actions that require information about the webhook being fired, the payload, and the response.

@danihodovic
Copy link
Owner

Hello mr Abborg. Can you list a few example use cases for this pull-request?

@abborg
Copy link
Author

abborg commented Feb 4, 2025

My intended use case for these hooks is to allow for emitting metrics or traces from before and after the webhook fires. The hooks could also be used to allow for adding specific headers or manipulating the payload - for example to sanitize fields being sent for PII or other sensitive data.

@danihodovic
Copy link
Owner

For serialization #35 is related.

For metrics / traces I use Prometheus and https://github.com/danihodovic/celery-exporter to track success / failure of webhook events

@abborg
Copy link
Author

abborg commented Feb 5, 2025

I think your celery-exporter might solve my use case nicely. I'll take a look and follow up. Thanks!

@danihodovic
Copy link
Owner

I think your celery-exporter might solve my use case nicely. I'll take a look and follow up. Thanks!

Once you plug in Prometheus, use the generated Grafana dashboards to see aggregated task metrics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants