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

Query too long #668

Open
abursavich opened this issue Jul 8, 2024 · 1 comment · May be fixed by #670
Open

Query too long #668

abursavich opened this issue Jul 8, 2024 · 1 comment · May be fixed by #670
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@abursavich
Copy link

abursavich commented Jul 8, 2024

What happened?:

The query that matches all ready pods in a large deployment is being rejected by VictoriaMetrics.

E0703 20:49:59.724673 1 provider.go:150] unable to fetch metrics from prometheus: 422: too long query; got 25852 bytes; mustn't exceed -search.maxQueryLen=16384 bytes

We can (and will for now) increase the maximum size of a query that VictoriaMetrics allows, but we could also reduce the size of the query that prometheus-adapter constructs.

Given these pods:

  1. podfromareplicasetwithalongname-24vm7
  2. podfromareplicasetwithalongname-4h7zn
  3. podfromareplicasetwithalongname-gpmg2
  4. podfromareplicasetwithalongname-scgch
  5. podfromareplicasetwithalongname-x7ks6

The constructed query is:
some_metric_name{namespace="foobar",pod=~"podfromareplicasetwithalongname-24vm7|podfromareplicasetwithalongname-4h7zn|podfromareplicasetwithalongname-gpmg2|podfromareplicasetwithalongname-scgch|podfromareplicasetwithalongname-x7ks6"}

But it could be:
some_metric_name{namespace="foobar",pod=~""podfromareplicasetwithalongname-(24vm7|4h7zn|gpmg2|scgch|x7ks6)"}

Now imagine that with 1500 pods instead of 5.

What did you expect to happen?:

Prometheus-adapter should make a reasonable effort to create small queries.

@abursavich abursavich added the kind/bug Categorizes issue or PR as related to a bug. label Jul 8, 2024
@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Jul 8, 2024
@dgrisonnet
Copy link
Member

/triage accepted
/assign @abursavich

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants