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
056fdf51
Commit
056fdf51
authored
Dec 26, 2014
by
Julius Volz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve and expand naming conventions doc.
parent
aab315f4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
15 deletions
+14
-15
naming.md
content/docs/practices/naming.md
+14
-15
No files found.
content/docs/practices/naming.md
View file @
056fdf51
...
@@ -23,27 +23,26 @@ A metric name:
...
@@ -23,27 +23,26 @@ A metric name:
*
<code>
api
\_
http
\_
request
\_
latency
\_
<b>
milliseconds
</b></code>
*
<code>
api
\_
http
\_
request
\_
latency
\_
<b>
milliseconds
</b></code>
*
<code>
node
\_
memory
\_
usage
\_
<b>
bytes
</b></code>
*
<code>
node
\_
memory
\_
usage
\_
<b>
bytes
</b></code>
*
<code>
api
\_
http
\_
requests
\_
<b>
total
</b></code>
(for an accumulating count)
*
<code>
api
\_
http
\_
requests
\_
<b>
total
</b></code>
(for an accumulating count)
*
should represent the same logical thing-being-measured
*
should represent the same logical thing-being-measured
across all label dimensions
*
request duration
*
request duration
*
bytes of data transfer
*
bytes of data transfer
*
instantaneous resource usage as a percentage
*
instantaneous resource usage as a percentage
As a rule of thumb,
if you
`sum()`
or
`avg()`
over all dimensions of a given
As a rule of thumb,
either the
`sum()`
or the
`avg()`
over all dimensions of a
metric, the result should be meaningful (though not necessarily useful). If i
t
given metric should be meaningful (though not necessarily useful). If it isn'
t
isn't meaningful, split the data up into multiple metrics. For example, having
meaningful, split the data up into multiple metrics. For example, having the
the
capacity of various queues in the metric is good, mixing the capacity of a
capacity of various queues in the metric is good, mixing the capacity of a
queue with the
number of elements
is not.
queue with the
current number of elements in the queue
is not.
## Labels
## Labels
Use labels to differentiate
Use labels to differentiate the characteristics of the thing that is being measured:
*
class of thing-being-measured
*
`api_http_requests_total`
- differentiate request types:
`type={create,update,delete}`
*
`api_request_duration_nanoseconds`
- differentiate request stages:
`stage={extract,transform,load}`
Remember that every unique (label, value) pair represents a new axis of
cardinality for the associated metric, which can dramatically increase the
amount of data stored.
*
`api_http_requests_total`
- differentiate request types:
`type="create|update|delete"`
*
`api_request_duration_nanoseconds`
- differentiate request stages:
`stage="extract|transform|load"`
CAUTION:
<b>
CAUTION:
</b>
Remember that every unique key-value label pair
represents a new time series, which can dramatically increase the amount of
data stored. Don't use labels to store dimensions with high cardinality (many
different label values), such as user IDs, email addresses, or other unbounded
sets of values.
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