Skip to content

Commit a76c8f5

Browse files
committed
ref(metric-meta): Add support for metric metadata
1 parent 4d133f5 commit a76c8f5

22 files changed

+685
-22
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
4+
## Unreleased
5+
6+
- Add support for metric metadata. ([#2751](https://github.com/getsentry/relay/pull/2751))
7+
38
## 23.11.1
49

510
**Features**:

Cargo.lock

+6-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+3-1
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,16 @@ debug = true
1515

1616
[workspace.dependencies]
1717
anyhow = "1.0.66"
18-
chrono = { version = "0.4.29", default-features = false, features = [
18+
chrono = { version = "0.4.31", default-features = false, features = [
1919
"std",
2020
"serde",
2121
] }
2222
clap = { version = "4.4.6" }
2323
criterion = "0.5"
2424
futures = { version = "0.3", default-features = false, features = ["std"] }
2525
insta = { version = "1.31.0", features = ["json", "redactions", "ron"] }
26+
hash32 = "0.3.1"
27+
hashbrown = "0.13.2"
2628
itertools = "0.10.5"
2729
once_cell = "1.13.1"
2830
rand = "0.8.5"

relay-dynamic-config/src/feature.rs

+3
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ pub enum Feature {
3333
/// Enable processing profiles
3434
#[serde(rename = "organizations:profiling")]
3535
Profiling,
36+
/// Enable metric metadata.
37+
#[serde(rename = "organizations:metric-meta")]
38+
MetricMeta,
3639

3740
/// Deprecated, still forwarded for older downstream Relays.
3841
#[serde(rename = "organizations:transaction-name-mark-scrubbed-as-sanitized")]

relay-metrics/Cargo.toml

+4-1
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,21 @@ publish = false
1212
[dependencies]
1313
bytecount = "0.6.0"
1414
fnv = "1.0.7"
15-
hash32 = "0.3.1"
15+
hash32 = { workspace = true }
16+
hashbrown = { workspace = true }
1617
itertools = { workspace = true }
1718
relay-base-schema = { path = "../relay-base-schema" }
1819
relay-common = { path = "../relay-common" }
1920
relay-log = { path = "../relay-log" }
21+
relay-redis = { path = "../relay-redis" }
2022
relay-statsd = { path = "../relay-statsd" }
2123
relay-system = { path = "../relay-system" }
2224
serde = { workspace = true }
2325
serde_json = { workspace = true }
2426
smallvec = { workspace = true }
2527
thiserror = { workspace = true }
2628
tokio = { workspace = true, features = ["time"] }
29+
chrono = { workspace = true }
2730

2831
[dev-dependencies]
2932
criterion = { workspace = true }

relay-metrics/src/bucket.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use std::borrow::Cow;
12
use std::collections::{BTreeMap, BTreeSet};
23
use std::iter::FusedIterator;
34
use std::{fmt, mem};
@@ -416,7 +417,7 @@ fn parse_mri(string: &str, ty: MetricType) -> Option<MetricResourceIdentifier> {
416417

417418
Some(MetricResourceIdentifier {
418419
ty,
419-
name,
420+
name: Cow::Borrowed(name),
420421
namespace: raw_namespace.parse().ok()?,
421422
unit,
422423
})

relay-metrics/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,13 @@ pub mod aggregator;
7272

7373
mod aggregatorservice;
7474
mod bucket;
75+
mod meta;
7576
mod protocol;
7677
mod router;
7778
mod statsd;
7879

7980
pub use aggregatorservice::*;
8081
pub use bucket::*;
82+
pub use meta::*;
8183
pub use protocol::*;
8284
pub use router::*;

0 commit comments

Comments
 (0)