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

Add Sentry as a Provider #172

Closed
lwj opened this issue Mar 25, 2021 · 3 comments · Fixed by #176
Closed

Add Sentry as a Provider #172

lwj opened this issue Mar 25, 2021 · 3 comments · Fixed by #176
Assignees
Labels
area/alerting Alerting related issues and PRs enhancement New feature or request

Comments

@lwj
Copy link
Contributor

lwj commented Mar 25, 2021

We'd like to push reconciliation events to sentry. I've already done some investigation and started implementing using the sentry-go library. Happy to make a PR and push my changes upstream if other members would find this integration useful.

@stefanprodan
Copy link
Member

I see that sentry-go is a well maintained package, I'm ok with having Sentry support in Flux. We need to determine what extra fields the Provider needs, I'm not a Sentry user and I can't tell.

@lwj could write here a proposal of how the Provider should look? Thanks

@stefanprodan stefanprodan added area/alerting Alerting related issues and PRs enhancement New feature or request labels Mar 26, 2021
@lwj
Copy link
Contributor Author

lwj commented Mar 26, 2021

Hi @stefanprodan, thanks for the response. I can give a brief overview:

Sentry uses something called a DSN that gets passed to the SDK to inform it where to send events to. This is just a URL provided by Sentry with the following format:

{PROTOCOL}://{PUBLIC_KEY}:{SECRET_KEY}@{HOST}{PATH}/{PROJECT_ID}

Sentry users should already be familiar with using this DSN for integration, so I see no reason why we couldn't re-use the existing address field that other providers make use of. This should be the only field we need for the Sentry Provider.

For dispatching events, here is the payload model: https://develop.sentry.dev/sdk/event-payloads/

The go-sentry SDK will populate some of these fields for us (event_id, platform, sdk) - here is my proposal for mapping the others:

&sentry.Event{
		Timestamp:  event.Timestamp.Time,
		Level:      sentry.Level(event.Severity),
		ServerName: event.ReportingController,
		Extra:      event.Metadata,
		Message:    event.Message,
	}

@stefanprodan
Copy link
Member

@lwj this looks great, I wasn't aware that DSN is just a URL, it fits perfectly with what we have in our API.

I'll assign this issue to you, looking forward to your PR, thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/alerting Alerting related issues and PRs enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants