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

minInterval doesn't get applied #647

Closed
rdubrock opened this issue Mar 15, 2024 · 1 comment
Closed

minInterval doesn't get applied #647

rdubrock opened this issue Mar 15, 2024 · 1 comment
Labels
type/bug Something isn't working

Comments

@rdubrock
Copy link

rdubrock commented Mar 15, 2024

Values passed to the minInterval field on query runners don't get applied to the resulting query. I've noticed that setting the minStep in Explore will result in that value getting passed to the interval property when sending a query. I have a query that doesn't work with an interval less than 1 minute, and I can't get it to work in scenes without setting the maxDataPoints extremely low. Example query runner:

function getQueryRunner(metrics: DataSourceRef) {
  const runner = new SceneQueryRunner({
    datasource: metrics,
    minInterval: '1m',
    maxDataPoints: 10,
    queries: [
      {
        expr: 'sum(rate(probe_all_duration_seconds_sum{probe=~"$probe", instance="$instance", job="$job"}[$__rate_interval]))',
        hide: false,
        instant: false,
        range: true,
        legendFormat: 'sum',
        refId: 'A',
      },
      {
        expr: 'sum(rate(probe_all_duration_seconds_count{probe=~"$probe", instance="$instance", job="$job"}[$__rate_interval]))',
        hide: false,
        instant: false,
        range: true,
        legendFormat: 'count',
        refId: 'B',
      },
    ],
  });

Resulting network request:

{
"queries": [
  {
    "expr": "sum(rate(probe_all_duration_seconds_sum{probe=~\".*\", instance=\"https://test-api.k6.io/\", job=\"many headers\"}[$__rate_interval]))",
    "hide": false,
    "instant": false,
    "range": true,
    "legendFormat": "sum",
    "refId": "A",
    "datasource": { "type": "prometheus", "uid": "P1F11F698EC8F0954" },
    "exemplar": false,
    "requestId": "1A",
    "utcOffsetSec": -28800,
    "interval": "",
    "datasourceId": 2,
    "intervalMs": 120000,
    "maxDataPoints": 10
  },
  {
    "expr": "sum(rate(probe_all_duration_seconds_count{probe=~\".*\", instance=\"https://test-api.k6.io/\", job=\"many headers\"}[$__rate_interval]))",
    "hide": false,
    "instant": false,
    "range": true,
    "legendFormat": "count",
    "refId": "B",
    "datasource": { "type": "prometheus", "uid": "P1F11F698EC8F0954" },
    "exemplar": false,
    "requestId": "1B",
    "utcOffsetSec": -28800,
    "interval": "",
    "datasourceId": 2,
    "intervalMs": 120000,
    "maxDataPoints": 10
  }
],
"from": "1710535097097",
"to": "1710535997097"
}

The max data points get applied, but interval is blank and intervalMs is for 2 minutes, not 1 minute

@rdubrock rdubrock added the type/bug Something isn't working label Mar 15, 2024
@torkelo
Copy link
Member

torkelo commented Mar 15, 2024

@rdubrock not a scenes issue , it's a Prometheus bug/issue , take it up with them.

We send the correct interval to Prometheus datasource

@torkelo torkelo closed this as not planned Won't fix, can't repro, duplicate, stale Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants