Skip to content

Commit 0b3b433

Browse files
hdostTommyCpp
andauthored
opentelemetry-prometheus: Remove deprecate call (open-telemetry#727)
Remove depcecated call to PrometheusExporter::new() which was deprecated in favor of using ExporterBuilder for new Exporters. Signed-off-by: Harold Dost <[email protected]> Co-authored-by: Zhongyang Wu <[email protected]>
1 parent 60af6e1 commit 0b3b433

File tree

2 files changed

+6
-26
lines changed

2 files changed

+6
-26
lines changed

opentelemetry-prometheus/CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
# Changelog
22

3+
## Unreleased
4+
5+
### Removed
6+
- BREAKING: `PrometheusExporter::new()` removed. Use `ExporterBuilder`.
7+
38
## v0.10.0
49

510
### Added
611

7-
- Added `prometheus-encoding` feature to export prometheus encoders #652
12+
- Added `prometheus-encoding` feature to export prometheus encoders #652
813
- Added `with_aggregator_selector` option #667
914

1015
### Changed

opentelemetry-prometheus/src/lib.rs

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -324,31 +324,6 @@ pub struct PrometheusExporter {
324324
}
325325

326326
impl PrometheusExporter {
327-
#[deprecated(
328-
since = "0.9.0",
329-
note = "Please use the ExporterBuilder to initialize a PrometheusExporter"
330-
)]
331-
/// Create a new prometheus exporter
332-
pub fn new(
333-
registry: prometheus::Registry,
334-
controller: PullController,
335-
host: String,
336-
port: u16,
337-
) -> Result<Self, MetricsError> {
338-
let controller = Arc::new(Mutex::new(controller));
339-
let collector = Collector::with_controller(controller.clone());
340-
registry
341-
.register(Box::new(collector))
342-
.map_err(|e| MetricsError::Other(e.to_string()))?;
343-
344-
Ok(PrometheusExporter {
345-
registry,
346-
controller,
347-
host,
348-
port,
349-
})
350-
}
351-
352327
/// Returns a reference to the current prometheus registry.
353328
pub fn registry(&self) -> &prometheus::Registry {
354329
&self.registry

0 commit comments

Comments
 (0)