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

application/x-www-form-urlencoded support #1381

Merged
merged 2 commits into from
Dec 7, 2019

Conversation

owen-d
Copy link
Member

@owen-d owen-d commented Dec 6, 2019

What

Adds POST + application/x-www-form-urlencoded support for the querier. This is mainly to maintain parity w/ the upstream prometheus implementation.

This is primarily for

  • POST /api/v1/query_range
  • POST /api/v1/query

but also will be useful for

  • POST /api/v1/series

Closes #1379

example

$  curl -XPOST -s "http://localhost:3100/loki/api/v1/query" --data-urlencode 'query=sum(rate({job="default/promtail"}[10m])) by (level)' | jq
{
  "status": "success",
  "data": {
    "resultType": "vector",
    "result": [
      {
        "metric": {},
        "value": [
          1575661320.349,
          "0.055"
        ]
      }
    ]
  }
}

pkg/querier/http.go Outdated Show resolved Hide resolved
@cyriltovena cyriltovena merged commit 5227f5b into grafana:master Dec 7, 2019
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.

HTTP body application/x-www-form-urlencoded support
3 participants