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 pagination support for Sentry endpoints #77

Merged

Conversation

olegpixel
Copy link
Contributor

Overview
This PR introduces pagination support for Projects endpoint, enhancing the ability to retrieve data from Sentry's API efficiently.

Sentry Projects Endpoint - https://docs.sentry.io/api/organizations/list-an-organizations-projects/
Sentry Pagination Docs - https://docs.sentry.io/api/pagination/
Link Header - https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Link

Changes Made

Added a new FetchWithPagination method in the SentryClient to parse the Link header and extract the next page URL when available, aligning the code with Sentry's pagination guidelines.

Added a new GetAllProjects function to utilise the enhanced Fetch method, enabling it to fetch all projects across multiple pages as needed.

This change will address and resolve the issue described here - #31

@olegpixel olegpixel requested a review from a team as a code owner September 26, 2023 03:44
@olegpixel olegpixel requested review from asimpson, bossinc, aangelisc and adamyeats and removed request for a team September 26, 2023 03:44
@CLAassistant
Copy link

CLAassistant commented Sep 26, 2023

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@aangelisc aangelisc left a comment

Choose a reason for hiding this comment

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

Hi @olegpixel, these changes LGTM! Just one question in the comments

pkg/sentry/sentry.go Outdated Show resolved Hide resolved
@aangelisc
Copy link
Contributor

Hey @olegpixel, the build is failing because of an unknown word peterhellberg. If you update the cspell.config.json file with this word the build will pass and we can merge 😊

@olegpixel
Copy link
Contributor Author

Hi @aangelisc, I've updated cspell.config.json file. Thank you

@aangelisc
Copy link
Contributor

Perfect, thanks again for the contribution @olegpixel!

@aangelisc aangelisc merged commit 0bd40eb into grafana:main Oct 13, 2023
6 of 7 checks passed
@olegpixel olegpixel deleted the olegyevik-sentry-datasource-select-project branch June 10, 2024 22:00
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.

3 participants