Skip to content

Commit 18d0b2d

Browse files
committed
refactor: make PushMetricsExporter non-plural
1 parent 3e1dc85 commit 18d0b2d

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

opentelemetry-otlp/src/metric.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use opentelemetry::metrics::MetricResult;
2020

2121
use opentelemetry_sdk::metrics::{
2222
data::{ResourceMetrics, Temporality},
23-
exporter::PushMetricsExporter,
23+
exporter::PushMetricExporter,
2424
};
2525
use std::fmt::{Debug, Formatter};
2626

@@ -139,7 +139,7 @@ impl Debug for MetricExporter {
139139
}
140140

141141
#[async_trait]
142-
impl PushMetricsExporter for MetricExporter {
142+
impl PushMetricExporter for MetricExporter {
143143
async fn export(&self, metrics: &mut ResourceMetrics) -> MetricResult<()> {
144144
self.client.export(metrics).await
145145
}

opentelemetry-sdk/src/metrics/exporter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use super::data::Temporality;
1111
///
1212
/// This is the final component in the metric push pipeline.
1313
#[async_trait]
14-
pub trait PushMetricsExporter: Send + Sync + 'static {
14+
pub trait PushMetricExporter: Send + Sync + 'static {
1515
/// Export serializes and transmits metric data to a receiver.
1616
///
1717
/// All retry logic must be contained in this function. The SDK does not

opentelemetry-sdk/src/metrics/periodic_reader.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use opentelemetry::{
1818

1919
use crate::runtime::Runtime;
2020
use crate::{
21-
metrics::{exporter::PushMetricsExporter, reader::SdkProducer},
21+
metrics::{exporter::PushMetricExporter, reader::SdkProducer},
2222
Resource,
2323
};
2424

@@ -54,7 +54,7 @@ pub struct PeriodicReaderBuilder<E, RT> {
5454

5555
impl<E, RT> PeriodicReaderBuilder<E, RT>
5656
where
57-
E: PushMetricsExporter,
57+
E: PushMetricExporter,
5858
RT: Runtime,
5959
{
6060
fn new(exporter: E, runtime: RT) -> Self {
@@ -155,7 +155,7 @@ where
155155
///
156156
/// The [runtime] can be selected based on feature flags set for this crate.
157157
///
158-
/// The exporter can be any exporter that implements [PushMetricsExporter] such
158+
/// The exporter can be any exporter that implements [PushMetricExporter] such
159159
/// as [opentelemetry-otlp].
160160
///
161161
/// [collect]: MetricReader::collect
@@ -168,7 +168,7 @@ where
168168
/// use opentelemetry_sdk::metrics::PeriodicReader;
169169
/// # fn example<E, R>(get_exporter: impl Fn() -> E, get_runtime: impl Fn() -> R)
170170
/// # where
171-
/// # E: opentelemetry_sdk::metrics::exporter::PushMetricsExporter,
171+
/// # E: opentelemetry_sdk::metrics::exporter::PushMetricExporter,
172172
/// # R: opentelemetry_sdk::runtime::Runtime,
173173
/// # {
174174
///
@@ -181,15 +181,15 @@ where
181181
/// ```
182182
#[derive(Clone)]
183183
pub struct PeriodicReader {
184-
exporter: Arc<dyn PushMetricsExporter>,
184+
exporter: Arc<dyn PushMetricExporter>,
185185
inner: Arc<Mutex<PeriodicReaderInner>>,
186186
}
187187

188188
impl PeriodicReader {
189189
/// Configuration options for a periodic reader
190190
pub fn builder<E, RT>(exporter: E, runtime: RT) -> PeriodicReaderBuilder<E, RT>
191191
where
192-
E: PushMetricsExporter,
192+
E: PushMetricExporter,
193193
RT: Runtime,
194194
{
195195
PeriodicReaderBuilder::new(exporter, runtime)

opentelemetry-sdk/src/testing/metrics/in_memory_exporter.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::metrics::data;
22
use crate::metrics::data::{Histogram, Metric, ResourceMetrics, ScopeMetrics, Temporality};
3-
use crate::metrics::exporter::PushMetricsExporter;
3+
use crate::metrics::exporter::PushMetricExporter;
44
use async_trait::async_trait;
55
use opentelemetry::metrics::MetricError;
66
use opentelemetry::metrics::MetricResult;
@@ -244,7 +244,7 @@ impl InMemoryMetricExporter {
244244
}
245245

246246
#[async_trait]
247-
impl PushMetricsExporter for InMemoryMetricExporter {
247+
impl PushMetricExporter for InMemoryMetricExporter {
248248
async fn export(&self, metrics: &mut ResourceMetrics) -> MetricResult<()> {
249249
self.metrics
250250
.lock()

opentelemetry-stdout/src/metrics/exporter.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use core::{f64, fmt};
44
use opentelemetry::metrics::{MetricError, MetricResult};
55
use opentelemetry_sdk::metrics::{
66
data::{self, ScopeMetrics, Temporality},
7-
exporter::PushMetricsExporter,
7+
exporter::PushMetricExporter,
88
};
99
use std::fmt::Debug;
1010
use std::sync::atomic;
@@ -34,7 +34,7 @@ impl fmt::Debug for MetricExporter {
3434
}
3535

3636
#[async_trait]
37-
impl PushMetricsExporter for MetricExporter {
37+
impl PushMetricExporter for MetricExporter {
3838
/// Write Metrics to stdout
3939
async fn export(&self, metrics: &mut data::ResourceMetrics) -> MetricResult<()> {
4040
if self.is_shutdown.load(atomic::Ordering::SeqCst) {

0 commit comments

Comments
 (0)