Skip to content

Commit 4b1b80f

Browse files
authored
utf8: update doc for deprecated bool (#2698)
Signed-off-by: Owen Williams <[email protected]>
1 parent 9e87608 commit 4b1b80f

File tree

1 file changed

+13
-20
lines changed

1 file changed

+13
-20
lines changed

docs/guides/utf8.md

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,29 +17,20 @@ This document guides you through the UTF-8 transition details.
1717

1818
## Go Instrumentation
1919

20-
Currently, metrics created by the official Prometheus [client_golang library](https://github.com/prometheus/client_golang) will reject UTF-8 names
21-
by default. It is necessary to change the default validation scheme to allow
22-
UTF-8. The requirement to set this value will be removed in a future version of
23-
the common library.
20+
Currently, metrics created by the official Prometheus [client_golang
21+
library](https://github.com/prometheus/client_golang) accept UTF-8 names by
22+
default.
2423

25-
```golang
26-
import "github.com/prometheus/common/model"
27-
28-
func init() {
29-
model.NameValidationScheme = model.UTF8Validation
30-
}
31-
```
32-
33-
If users want to enforce the legacy character set, they can set the validation
34-
scheme to `LegacyValidation`.
35-
36-
Setting the validation scheme must be done before the instantiation of metrics
37-
and can be set on the fly if desired.
24+
Previously, documentation recommended that users override the value of
25+
`model.NameValidationScheme` to select legacy validation by default. This
26+
boolean is now deprecated and should always be set to UTF8Validation. Legacy
27+
validation enforcement, if desired, should be done by individual implementations
28+
calling the appropriate validation APIs and is no longer a library feature.
3829

3930
### Instrumenting in other languages
4031

41-
Other client libraries may have similar requirements to set the validation
42-
scheme. Check the documentation for the library you are using.
32+
Other client libraries may not yet support UTF-8 and may require special
33+
handling or configuration. Check the documentation for the library you are using.
4334

4435
## Configuring Name Validation during Scraping
4536

@@ -98,7 +89,9 @@ is no way to enforce the legacy character set validation with Remote Write 2.0.
9889

9990
## OTLP Metrics
10091

101-
OTLP receiver in Prometheus 3.0 still normalizes all names to Prometheus format by default. You can change this in `otlp` section of the Prometheus configuration as follows:
92+
OTLP receiver in Prometheus 3.0 still normalizes all names to Prometheus format
93+
by default. You can change this in `otlp` section of the Prometheus
94+
configuration as follows:
10295

10396

10497
otlp:

0 commit comments

Comments
 (0)