Skip to content

Commit 1ea3664

Browse files
authored
ref(metrics): remove features and code related to the old metrics beta (#740)
* ref(metrics): remove features and code related to the old metrics beta * remove statsd thing
1 parent e1fc510 commit 1ea3664

File tree

14 files changed

+0
-2066
lines changed

14 files changed

+0
-2066
lines changed

sentry-core/Cargo.toml

-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ client = ["rand"]
2626
# and macros actually expand features (and extern crate) where they are used!
2727
debug-logs = ["dep:log"]
2828
test = ["client"]
29-
metrics = ["sentry-types/metrics", "regex", "crc32fast"]
30-
metrics-cadence1 = ["dep:cadence", "metrics"]
3129

3230
[dependencies]
3331
cadence = { version = "1.4.0", optional = true }

sentry-core/src/cadence.rs

-163
This file was deleted.

sentry-core/src/client.rs

-31
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ use sentry_types::protocol::v7::SessionUpdate;
1010
use sentry_types::random_uuid;
1111

1212
use crate::constants::SDK_INFO;
13-
#[cfg(feature = "metrics")]
14-
use crate::metrics::{self, MetricAggregator};
1513
use crate::protocol::{ClientSdkInfo, Event};
1614
use crate::session::SessionFlusher;
1715
use crate::types::{Dsn, Uuid};
@@ -46,8 +44,6 @@ pub struct Client {
4644
options: ClientOptions,
4745
transport: TransportArc,
4846
session_flusher: RwLock<Option<SessionFlusher>>,
49-
#[cfg(feature = "metrics")]
50-
metric_aggregator: RwLock<Option<MetricAggregator>>,
5147
integrations: Vec<(TypeId, Arc<dyn Integration>)>,
5248
pub(crate) sdk_info: ClientSdkInfo,
5349
}
@@ -68,17 +64,10 @@ impl Clone for Client {
6864
transport.clone(),
6965
self.options.session_mode,
7066
)));
71-
#[cfg(feature = "metrics")]
72-
let metric_aggregator = RwLock::new(Some(MetricAggregator::new(
73-
transport.clone(),
74-
&self.options,
75-
)));
7667
Client {
7768
options: self.options.clone(),
7869
transport,
7970
session_flusher,
80-
#[cfg(feature = "metrics")]
81-
metric_aggregator,
8271
integrations: self.integrations.clone(),
8372
sdk_info: self.sdk_info.clone(),
8473
}
@@ -147,16 +136,10 @@ impl Client {
147136
options.session_mode,
148137
)));
149138

150-
#[cfg(feature = "metrics")]
151-
let metric_aggregator =
152-
RwLock::new(Some(MetricAggregator::new(transport.clone(), &options)));
153-
154139
Client {
155140
options,
156141
transport,
157142
session_flusher,
158-
#[cfg(feature = "metrics")]
159-
metric_aggregator,
160143
integrations,
161144
sdk_info,
162145
}
@@ -323,23 +306,11 @@ impl Client {
323306
}
324307
}
325308

326-
/// Captures a metric and sends it to Sentry on the next flush.
327-
#[cfg(feature = "metrics")]
328-
pub fn add_metric(&self, metric: metrics::Metric) {
329-
if let Some(ref aggregator) = *self.metric_aggregator.read().unwrap() {
330-
aggregator.add(metric)
331-
}
332-
}
333-
334309
/// Drains all pending events without shutting down.
335310
pub fn flush(&self, timeout: Option<Duration>) -> bool {
336311
if let Some(ref flusher) = *self.session_flusher.read().unwrap() {
337312
flusher.flush();
338313
}
339-
#[cfg(feature = "metrics")]
340-
if let Some(ref aggregator) = *self.metric_aggregator.read().unwrap() {
341-
aggregator.flush();
342-
}
343314
if let Some(ref transport) = *self.transport.read().unwrap() {
344315
transport.flush(timeout.unwrap_or(self.options.shutdown_timeout))
345316
} else {
@@ -356,8 +327,6 @@ impl Client {
356327
/// `shutdown_timeout` in the client options.
357328
pub fn close(&self, timeout: Option<Duration>) -> bool {
358329
drop(self.session_flusher.write().unwrap().take());
359-
#[cfg(feature = "metrics")]
360-
drop(self.metric_aggregator.write().unwrap().take());
361330
let transport_opt = self.transport.write().unwrap().take();
362331
if let Some(transport) = transport_opt {
363332
sentry_debug!("client close; request transport to shut down");

sentry-core/src/lib.rs

-6
Original file line numberDiff line numberDiff line change
@@ -136,19 +136,13 @@ pub use crate::performance::*;
136136
pub use crate::scope::{Scope, ScopeGuard};
137137
pub use crate::transport::{Transport, TransportFactory};
138138

139-
#[cfg(all(feature = "client", feature = "metrics-cadence1"))]
140-
pub mod cadence;
141139
// client feature
142140
#[cfg(feature = "client")]
143141
mod client;
144142
#[cfg(feature = "client")]
145143
mod hub_impl;
146-
#[cfg(all(feature = "client", feature = "metrics"))]
147-
pub mod metrics;
148144
#[cfg(feature = "client")]
149145
mod session;
150-
#[cfg(all(feature = "client", feature = "metrics"))]
151-
mod units;
152146

153147
#[cfg(feature = "client")]
154148
pub use crate::{client::Client, hub_impl::SwitchGuard as HubSwitchGuard};

0 commit comments

Comments
 (0)