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
fca980fb
Commit
fca980fb
authored
Jun 22, 2015
by
Fabian Reinartz
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #122 from prometheus/fabxc/lmatch
Update label matching documentation.
parents
b4b6c1f2
70404b7f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
basics.md
content/docs/querying/basics.md
+22
-0
No files found.
content/docs/querying/basics.md
View file @
fca980fb
...
...
@@ -84,6 +84,28 @@ For example, this selects all `http_requests_total` time series for `staging`,
http_requests_total{environment=~"staging|testing|development",method!="GET"}
Label matchers that match empty label values also select all time series that do
not have the specific label set at all.
Vector selectors must either specify a name or at least one label matcher
that does not match the empty string. The following expression is illegal:
{job=~".*"} # Bad!
In contrast, these expressions are valid as they both have a selector that does not
match empty label values.
{job=~".+"} # Good!
{job=~".*",method="get"} # Good!
Label matchers can also be applied to metric names by matching against the internal
`__name__`
label. For example, the expression
`http_requests_total`
is equivalent to
`{__name__="http_requests_total"}`
. Matchers other than
`=`
(
`!=`
,
`=~`
,
`!~`
) may also be used.
The following expression selects all metrics that have a name starting with
`job:`
:
{__name__=~"^job:.*"}
### Range Vector Selectors
Range vector literals work like instant vector literals, except that they
...
...
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