Skip to content

Commit 73fc7d9

Browse files
authored
Merge pull request #1298 from grafana/feat/add-invalid-metric-names-insights
Add invalid metric names to performance insights
2 parents 5dc729f + 2dc1e4f commit 73fc7d9

File tree

2 files changed

+17
-10
lines changed

2 files changed

+17
-10
lines changed

src/data/markdown/docs/03 cloud/02 Analyzing Results/02 Performance Insights.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ k6 categorizes performance insights into three sets:
2525
- [Too many metrics](#too-many-metrics)
2626
- [Too many time series](#too-many-time-series)
2727
- [Outdated k6 Release Used](#outdated-k6-release-used)
28+
- [Invalid metric names](#invalid-metric-names)
2829
- [High load generator CPU usage](#high-load-generator-cpu-usage)
2930
- [High load generator memory usage](#high-load-generator-memory-usage)
3031

@@ -248,6 +249,17 @@ for (let id = 1; id <= 1000; id++) {
248249
- Update the k6 binary that your CI/CD pipeline uses to run tests.
249250
- If you're part of an organization or team, collectively decide on a version of k6 to use going forward for consistency and ease of comparison.
250251

252+
### Invalid metric names
253+
254+
_Identifier_: `best_practice_invalid_metric_names`
255+
256+
- **Happens when**:
257+
you tag your custom metrics with invalid names.
258+
- **Recommendations**:
259+
- Ensure your custom metric names comply with OpenTelemetry and [Prometheus limitations](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels). Such as:
260+
- Only contain valid symbols of ASCII letters, numbers, or `_`.
261+
- Metric names must not start with a number.
262+
251263
## Health alerts
252264

253265
Health alerts happen when the load generator has high resource utilization.
@@ -367,6 +379,7 @@ For all insights and their identifiers, refer to the table below:
367379
| Too Many Metrics | `best_practice_too_many_metrics` | `best_practice` |
368380
| Too Many Time Series | `best_practice_too_many_time_series` | `best_practice` |
369381
| Outdated k6 Release Used | `best_practice_outdated_k6_release_used` | `best_practice` |
382+
| Invalid Metric Names | `best_practice_invalid_metric_names ` | `best_practice` |
370383
| High Load Generator CPU Usage | `health_high_loadgen_cpu_usage` | `health` |
371384
| High Load Generator Memory Usage | `health_high_loadgen_mem_usage` | `health` |
372385

src/data/markdown/translated-guides/en/02 Using k6/02 Metrics.md

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -107,17 +107,11 @@ In that output, all the metrics that start with `http`, `iteration`, and `vu` ar
107107
For details of all metrics, refer to the [Metrics reference](/using-k6/metrics/reference/).
108108
109109
110-
### Metric name restrictions
110+
## Metric name restrictions
111111
112-
<Blockquote mod="warning" title="">
112+
Metric names must comply with OpenTelemetry and [Prometheus limitations](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels).
113113
114-
In the future, metrics names will be further limited to comply with OpenTelemetry and Prometheus limitations.
115-
116-
That means metric names can be 1 to 63 symbols of ASCII letters, numbers, or `_`. Metric names must not start with a number.
117-
118-
</Blockquote>
119-
120-
At the moment, a metric name can be 1 to 128 symbols of:
114+
That means they must not start with a number and a metric name can be 1 to 63 symbols of:
121115
1. any Unicode Letters
122116
2. any Unicode Number
123-
3. `.`, `_`, ` `, `!`, `?`. `/`, `#`, `(`. `)`, `<`, `>`, `%` and `-`
117+
3. `_` (an underscore)

0 commit comments

Comments
 (0)