Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
docs
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
docs
Commits
e5f1acae
Commit
e5f1acae
authored
9 years ago
by
Tobias Schmidt
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #261 from prometheus/update-api-docs
Document query API changes
parents
404350e5
4d2bb1ec
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
api.md
content/docs/querying/api.md
+12
-4
No files found.
content/docs/querying/api.md
View file @
e5f1acae
...
@@ -14,9 +14,15 @@ The API response format is JSON. Every successful API request returns a `2xx`
...
@@ -14,9 +14,15 @@ The API response format is JSON. Every successful API request returns a `2xx`
status code.
status code.
Invalid requests that reach the API handlers return a JSON error object
Invalid requests that reach the API handlers return a JSON error object
and the HTTP response code
`422 Unprocessable Entity`
and one of the following HTTP response codes:
(
[
RFC4918
](
http://tools.ietf.org/html/rfc4918#page-78
)
). Other non-
`2xx`
codes
may be returned for errors occurring before the API endpoint is reached.
-
`400 Bad Request`
when parameters are missing or incorrect.
-
`422 Unprocessable Entity`
when an expression can't be executed
(
[
RFC4918
](
http://tools.ietf.org/html/rfc4918#page-78
)
).
-
`503 Service Unavailable`
when queries time out or abort.
Other non-
`2xx`
codes may be returned for errors occurring before the API
endpoint is reached.
The JSON response envelope format is as follows:
The JSON response envelope format is as follows:
...
@@ -64,7 +70,9 @@ GET /api/v1/query
...
@@ -64,7 +70,9 @@ GET /api/v1/query
URL query parameters:
URL query parameters:
-
`query=<string>`
: Prometheus expression query string.
-
`query=<string>`
: Prometheus expression query string.
-
`time=<rfc3339 | unix_timestamp>`
: Evaluation timestamp.
-
`time=<rfc3339 | unix_timestamp>`
: Evaluation timestamp. Optional.
The current server time is used if the
`time`
parameter is omitted.
The
`data`
section of the query result has the following format:
The
`data`
section of the query result has the following format:
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment