Skip to content

Commit 458a841

Browse files
authored
Revert "feat: implement retries (#103)"
This reverts commit 68348f9.
1 parent 68348f9 commit 458a841

File tree

7 files changed

+75
-416
lines changed

7 files changed

+75
-416
lines changed

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ reqwest-client-rustls = ["opentelemetry-http/reqwest", "reqwest/rustls-tls"]
4747

4848
[dependencies]
4949
async-trait = "0.1"
50-
backon = { version = "1.5", default-features = false, features = ["futures-timer-sleep"] }
5150
bytes = "1"
5251
chrono = "0.4"
5352
flate2 = "1"

src/lib.rs

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -372,13 +372,7 @@ use opentelemetry_sdk::ExportError;
372372
use opentelemetry_sdk::Resource;
373373
#[cfg(feature = "live-metrics")]
374374
pub use quick_pulse::LiveMetricsSpanProcessor;
375-
use std::{
376-
convert::TryInto,
377-
error::Error as StdError,
378-
fmt::Debug,
379-
sync::{Arc, Mutex},
380-
time::Duration,
381-
};
375+
use std::{convert::TryInto, error::Error as StdError, fmt::Debug, sync::Arc};
382376
#[cfg(feature = "live-metrics")]
383377
use uploader_quick_pulse::PostOrPing;
384378

@@ -392,7 +386,6 @@ pub struct Exporter<C> {
392386
#[cfg(feature = "live-metrics")]
393387
live_ping_endpoint: http::Uri,
394388
instrumentation_key: String,
395-
retry_notify: Option<Arc<Mutex<dyn FnMut(&Error, Duration) + Send + 'static>>>,
396389
#[cfg(feature = "trace")]
397390
sample_rate: f64,
398391
#[cfg(any(feature = "trace", feature = "logs"))]
@@ -443,7 +436,6 @@ impl<C> Exporter<C> {
443436
&instrumentation_key,
444437
),
445438
instrumentation_key,
446-
retry_notify: None,
447439
#[cfg(feature = "trace")]
448440
sample_rate: 100.0,
449441
#[cfg(any(feature = "trace", feature = "logs"))]
@@ -483,7 +475,6 @@ impl<C> Exporter<C> {
483475
&connection_string.instrumentation_key,
484476
),
485477
instrumentation_key: connection_string.instrumentation_key,
486-
retry_notify: None,
487478
#[cfg(feature = "trace")]
488479
sample_rate: 100.0,
489480
#[cfg(any(feature = "trace", feature = "logs"))]
@@ -493,16 +484,6 @@ impl<C> Exporter<C> {
493484
})
494485
}
495486

496-
/// Set a retry notification function that is called when a request to upload telemetry to
497-
/// Application Insights failed and will be retried.
498-
pub fn with_retry_notify<N>(mut self, retry_notify: N) -> Self
499-
where
500-
N: FnMut(&Error, Duration) + Send + 'static,
501-
{
502-
self.retry_notify = Some(Arc::new(Mutex::new(retry_notify)));
503-
self
504-
}
505-
506487
/// Set endpoint used to ingest telemetry. This should consist of scheme and authrity. The
507488
/// exporter will call `/v2/track` on the specified endpoint.
508489
///

src/logs.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,9 @@ where
8383
.collect();
8484

8585
async move {
86-
crate::uploader::send(
87-
client.as_ref(),
88-
endpoint.as_ref(),
89-
envelopes,
90-
self.retry_notify.clone(),
91-
)
92-
.await
93-
.map_err(Into::into)
86+
crate::uploader::send(client.as_ref(), endpoint.as_ref(), envelopes)
87+
.await
88+
.map_err(Into::into)
9489
}
9590
}
9691

src/metrics.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,9 @@ where
7070
}
7171

7272
async move {
73-
crate::uploader::send(
74-
client.as_ref(),
75-
endpoint.as_ref(),
76-
envelopes,
77-
self.retry_notify.clone(),
78-
)
79-
.await
80-
.map_err(Into::into)
73+
crate::uploader::send(client.as_ref(), endpoint.as_ref(), envelopes)
74+
.await
75+
.map_err(Into::into)
8176
}
8277
}
8378

src/trace.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,9 @@ where
145145
.flat_map(|span| self.create_envelopes_for_span(span, &self.resource))
146146
.collect();
147147

148-
crate::uploader::send(
149-
client.as_ref(),
150-
endpoint.as_ref(),
151-
envelopes,
152-
self.retry_notify.clone(),
153-
)
154-
.await
155-
.map_err(Into::into)
148+
crate::uploader::send(client.as_ref(), endpoint.as_ref(), envelopes)
149+
.await
150+
.map_err(Into::into)
156151
}
157152

158153
fn set_resource(&mut self, resource: &Resource) {

0 commit comments

Comments
 (0)