Skip to content

feat: update otel versions for prometheus to 0.30 #3076

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions opentelemetry-prometheus/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## vNext

- Update `opentelemetry` dependency version to 0.30
- Update `opentelemetry_sdk` dependency version to 0.30
- Update `opentelemetry-semantic-conventions` dependency version to 0.30

## 0.29.1

Released 2025-April-11
Expand Down
6 changes: 3 additions & 3 deletions opentelemetry-prometheus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ rustdoc-args = ["--cfg", "docsrs"]

[dependencies]
once_cell = { version = "1.13" }
opentelemetry = { version = "0.29", default-features = false, features = ["metrics"] }
opentelemetry_sdk = { version = "0.29", default-features = false, features = ["metrics"] }
opentelemetry = { version = "0.30", default-features = false, features = ["metrics"] }
opentelemetry_sdk = { version = "0.30", default-features = false, features = ["metrics", "experimental_metrics_custom_reader"] }
prometheus = "0.14"
tracing = { version = ">=0.1.40", default-features = false, optional = true } # optional for opentelemetry internal logging

[dev-dependencies]
opentelemetry-semantic-conventions = { version = "0.29" }
opentelemetry-semantic-conventions = { version = "0.30" }
http-body-util = { version = "0.1" }
hyper = { version = "1.3", features = ["full"] }
hyper-util = { version = "0.1", features = ["full"] }
Expand Down
6 changes: 3 additions & 3 deletions opentelemetry-prometheus/src/config.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use core::fmt;
use once_cell::sync::OnceCell;
use opentelemetry_sdk::metrics::{ManualReaderBuilder, MetricError, MetricResult};
use opentelemetry_sdk::{error::OTelSdkError, metrics::ManualReaderBuilder};
use std::sync::{Arc, Mutex};

use crate::{Collector, PrometheusExporter, ResourceSelector};
Expand Down Expand Up @@ -115,7 +115,7 @@ impl ExporterBuilder {
}

/// Creates a new [PrometheusExporter] from this configuration.
pub fn build(self) -> MetricResult<PrometheusExporter> {
pub fn build(self) -> Result<PrometheusExporter, OTelSdkError> {
let reader = Arc::new(self.reader.build());

let collector = Collector {
Expand All @@ -134,7 +134,7 @@ impl ExporterBuilder {
let registry = self.registry.unwrap_or_default();
registry
.register(Box::new(collector))
.map_err(|e| MetricError::Other(e.to_string()))?;
.map_err(|e| OTelSdkError::InternalFailure(e.to_string()))?;

Ok(PrometheusExporter { reader })
}
Expand Down
Loading
Loading