Skip to content

Commit

Permalink
fix(server): Allow numbers in measurement names (#785)
Browse files Browse the repository at this point in the history
  • Loading branch information
dashed authored Sep 29, 2020
1 parent c030d66 commit e2f6068
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

**Features**:

- Add support for measurement ingestion. ([#724](https://github.com/getsentry/relay/pull/724))
- Add support for measurement ingestion. ([#724](https://github.com/getsentry/relay/pull/724), [#785](https://github.com/getsentry/relay/pull/785))
- Add support for scrubbing UTF-16 data in attachments ([#742](https://github.com/getsentry/relay/pull/742), [#784](https://github.com/getsentry/relay/pull/784))

**Bug Fixes**:
Expand Down
2 changes: 1 addition & 1 deletion py/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Unreleased

- Add support for measurement ingestion. ([#724](https://github.com/getsentry/relay/pull/724))
- Add support for measurement ingestion. ([#724](https://github.com/getsentry/relay/pull/724), [#785](https://github.com/getsentry/relay/pull/785))

## 0.8.0

Expand Down
8 changes: 4 additions & 4 deletions relay-general/src/protocol/measurements.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ impl FromValue for Measurements {

fn is_valid_measurement_name(name: &str) -> bool {
name.chars()
.all(|c| matches!(c, 'a'..='z' | 'A'..='Z' | '-' | '_' | '.'))
.all(|c| matches!(c, 'a'..='z' | 'A'..='Z' | '0'..='9' | '-' | '_' | '.'))
}

#[test]
Expand All @@ -63,7 +63,7 @@ fn test_measurements_serialization() {
let input = r#"{
"measurements": {
"LCP": {"value": 420.69},
" lcp_final.element-Size ": {"value": 1},
" lcp_final.element-Size123 ": {"value": 1},
"fid": {"value": 2020},
"cls": {"value": null},
"fp": {"value": "im a first paint"},
Expand All @@ -86,7 +86,7 @@ fn test_measurements_serialization() {
"lcp": {
"value": 420.69
},
"lcp_final.element-size": {
"lcp_final.element-size123": {
"value": 1.0
},
"missing_value": null
Expand Down Expand Up @@ -150,7 +150,7 @@ fn test_measurements_serialization() {
}),
);
measurements.insert(
"lcp_final.element-size".to_owned(),
"lcp_final.element-size123".to_owned(),
Annotated::new(Measurement {
value: Annotated::new(1f64),
}),
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/test_envelope.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def test_normalize_measurement_interface(
{
"measurements": {
"LCP": {"value": 420.69},
" lcp_final.element-Size ": {"value": 1},
" lcp_final.element-Size123 ": {"value": 1},
"fid": {"value": 2020},
"cls": {"value": None},
"fp": {"value": "im a first paint"},
Expand All @@ -92,7 +92,7 @@ def test_normalize_measurement_interface(
assert "measurements" in event, event
assert event["measurements"] == {
"lcp": {"value": 420.69},
"lcp_final.element-size": {"value": 1},
"lcp_final.element-size123": {"value": 1},
"fid": {"value": 2020},
"cls": {"value": None},
"fp": {"value": None},
Expand Down

0 comments on commit e2f6068

Please sign in to comment.