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

[Bug] Pagination Error #705

Open
em1064 opened this issue Nov 7, 2023 · 4 comments
Open

[Bug] Pagination Error #705

em1064 opened this issue Nov 7, 2023 · 4 comments

Comments

@em1064
Copy link

em1064 commented Nov 7, 2023

Describe the bug

Pagination works fine as long as the pages queried have data.

As soon as the page has no data, then this error will occur.
image

error getting data frame. unable to merge fields due to different fields
(Trace ID: 763b0b20f3281df1fac45df608e94594)

Version Details:

  • Grafana version : v10.3.0-63079
  • Plugin version : 2.1.0

Additional context

image

Other related Nice to haves

  • 5 page max is very small. The given argument for the limitation:

    • The limitation to the number of maximum pages per query is limited to 5. This is to avoid resource exhaustion and DDOSing of the target system.
    • I do not see how valid this is as you can achieve the same by duplicating the Query and changing the offset values manually. I got to 102 queries before I gave up. Then all is needed is to merge the queries into one when transforming data.
    • If there must be a limit, 100-500 seems fine. Especially when using List of Values Pagination type where the field value could take a Custom Variable in CSV.
      image
  • Would be great if Max pages supported variables for a dynamic value. Most APIs will have an endpoint to give a total count, which can be used to calculate numbers of pages to query.

@em1064 em1064 added the type/bug Something isn't working label Nov 7, 2023
@LudwigJan
Copy link

I am facing the same error:

Grafana version : 10.2.0-60982
Plugin version : 2.1.0

@yesoreyeram
Copy link
Collaborator

I am able to reproduce the behaviour when no results available in one of the pages. We can fix this in future iterations.

BTW, there is no plans to increase the max pages for the original reasons. ( you can somehow trigger 1000 pages. but we don't want to make it very obvious )

@yesoreyeram yesoreyeram moved this to Backlog in OSS Big Tent Feb 28, 2024
@justmedude
Copy link

Having a similar issue. I'm not a golang person (yet), but I'm thinking that this could be handled in:
https://github.com/yesoreyeram/grafana-plugins/blob/main/lib/go/transformations/merge.go

Maybe somewhere after line 26:

if len(outFrame.fields) == 0 {
  continue
}

@yesoreyeram yesoreyeram added datasource/Infinity and removed type/bug Something isn't working labels Nov 6, 2024
@ceccillia
Copy link

Having same issue here. It would be nice to have Max Pages as dynamic variables support field or skip pages with empty json.
My reproduce scenario:
{ "startAt": 0, "maxResults": 1000, "total": 3355, "issues": [] }
If I start at >3355 issue number - I have empty output in issues. But I cant change maxResults every time, because I have dynamic URL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

No branches or pull requests

5 participants