You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/apm/NAMING.md
+8-4Lines changed: 8 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,9 @@ Follow with a module name, team or area of code, e.g. `snapshot, repositories, i
32
32
The **hierarchy** of segments should be built by putting "more common" segments at the beginning. This facilitates the creation of new metrics under a common namespace.
33
33
Each element in the metric name specializes or describes the prefix that precedes it. Rule of thumb: you could truncate the name at any segment, and what you're left with is something that makes sense by itself.
34
34
35
-
Example: Prefer `.docs.deleted.total` over `.deleted.docs.total` so `.docs.ingested.total` could be added later.
35
+
Example: Prefer `es.indices.docs.deleted.total` over `es.indices.deleted.docs.total` so `es.indices.docs.ingested.total` could be added later.
36
+
37
+
**Note, to better highlight key differences, examples below starting with `.` omit the `es.` prefix and initial segments.**
36
38
37
39
Recommendations:
38
40
- When adding new metrics, [look for existing segments](#inspect-registered-metrics) as prefix in your domain. Also keep language consistent across the hierarchy, re-using segment names / terminology when possible.
@@ -44,7 +46,7 @@ E.g. stick to using `.error.total` if already in use rather than introducing `.f
44
46
### Name suffix
45
47
46
48
The metric suffix is essential to describe the semantics of a metric and guide consumers on how to interpret and use a metric appropriately.
47
-
If multiple suffixes are applicable, chose the most specific one.
49
+
If multiple suffixes are applicable, choose the most specific one.
48
50
49
51
*`total`: a monotonic metric (always increasing counter), e.g. <code>es.indices.docs.deleted.<strong>total</strong></code>)
50
52
* Note: such metrics typically report deltas that must be accumulated to get the total over a time window
@@ -72,7 +74,7 @@ Units are configured at registration time of the metric.
72
74
73
75
**WARNING** Do not use **high cardinality** attributes / dimensions. This might result in the APM Java agent dropping events.
74
76
75
-
It is not always straight forward to decide if something should part of the metric name or an attribute (dimension) of that metric. As a rule of thumb:
77
+
It is not always straight forward to decide if something should be part of the metric name or an attribute (dimension) of that metric. As a rule of thumb:
76
78
- any aggregation across any dimensions of a metric should be meaningful, and
77
79
- meaningful aggregations should be possible without having to aggregate over different metrics.
78
80
@@ -92,7 +94,9 @@ es(_<segment>)+
92
94
- The name may not exceed 255 characters.
93
95
94
96
Attributes that represent an entity should be named in singular.
95
-
If the attribute value represents a collection, it should be named in plural.
97
+
If the attribute value represents a collection, it should be named in plural, e.g.
98
+
-`es_security_realm_type`: singular, a single entity
99
+
-`es_rest_request_headers`: plural, a collection of headers
0 commit comments