prometheus / prometheus/client_rust
UTF8 Label Encoding
Open
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 606
- Forks
- 113
- Avg merge
- 9h 7m
- Merged PRs (30d)
- 8
Description
How should we encode utf8 labels?
if self.prometheus_full_utf8 {
write!(&mut key_encoder, "{}", key)?;
} else {
write!(&mut key_encoder, "{}", escape_label(key.as_str()))?;
}
I feel like doing something like this is less than ideal & that the key encoder itself should should either escape or not depending on the encoding (text or protobuf).
--
# HELP target_info Information about the target
# TYPE target_info info
target_info_info{service.name="xxx"} 1
# EOF
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the shown key_encoder path and compare the prometheus_full_utf8 branches, including escape_label and the text/protobuf encoding distinction. Determine the intended UTF-8 label encoding behavior and how it should apply across encodings; done means the project has a decided, consistent approach for the target_info example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- observability-sre
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100