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

Allow choosing fields to fetch for sentry events #400

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

abnvanand
Copy link
Contributor

@abnvanand abnvanand commented Jan 9, 2025

Sentry events API allows choosing which fields to fetch the data for.
sentry-datasource plugin currently hardcodes a list of fields making them as required fields.

This PR pulls those requiredFields into the UI component. A new component named "Fields" is prepopulated with those fields by default and allows users to remove those or add any custom field names.

image

Copy link
Contributor

@adamyeats adamyeats left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@abnvanand Thanks for the contribution! Looks like there's a failing test, could you please investigate?

 handlers_test.go:188: 
        	Error Trace:	/drone/src/pkg/handlers/handlers_test.go:188
        	Error:      	Not equal: 
        	            	expected: 11
        	            	actual  : 4
        	Test:       	TestSentryDatasource_Events/valid_events_query_should_produce_correct_result

Now that GetEvents returns a map slice instead of
a SentryEvent struct slice, the number of fields in
Frame will be the same as the JSON response by API server.
We also assert that the query string contains our custom
fields.
@abnvanand abnvanand marked this pull request as ready for review January 15, 2025 10:27
@abnvanand
Copy link
Contributor Author

@adamyeats I have fixed the failing test.
Thanks.

@abnvanand abnvanand requested a review from adamyeats January 15, 2025 10:40
Copy link
Contributor

@adamyeats adamyeats left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🚀 Thanks @abnvanand

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