Skip to content

Commit

Permalink
Merge branch 'main' into add_force_flush_log
Browse files Browse the repository at this point in the history
  • Loading branch information
lalitb authored Nov 14, 2024
2 parents 3aa6f8d + 3ac2d9f commit 9984bec
Show file tree
Hide file tree
Showing 71 changed files with 1,112 additions and 141 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ It's important to regularly review and remove the `otel_unstable` flag from the
The potential features include:

- Stable and non-experimental features that compliant to specification, and have a feature flag to minimize compilation size. Example: feature flags for signals (like `logs`, `traces`, `metrics`) and runtimes (`rt-tokio`, `rt-tokio-current-thread`, `rt-async-std`).
- Stable and non-experimental features, although not part of the specification, are crucial for enhancing the tracing/log crate's functionality or boosting performance. These features are also subject to discussion and approval by the OpenTelemetry Rust Maintainers. An example of such a feature is `logs_level_enabled`.
- Stable and non-experimental features, although not part of the specification, are crucial for enhancing the tracing/log crate's functionality or boosting performance. These features are also subject to discussion and approval by the OpenTelemetry Rust Maintainers.

All such features should adhere to naming convention `<signal>_<feature_name>`

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ observability tools.

| Signal/Component | Overall Status |
| -------------------- | ------------------ |
| Logs-API | Beta* |
| Logs-API | RC* |
| Logs-SDK | Beta |
| Logs-OTLP Exporter | Beta |
| Logs-Appender-Tracing | Beta |
| Metrics-API | Beta |
| Metrics-SDK | Alpha |
| Metrics-OTLP Exporter | Alpha |
| Metrics-API | RC |
| Metrics-SDK | Beta |
| Metrics-OTLP Exporter | Beta |
| Traces-API | Beta |
| Traces-SDK | Beta |
| Traces-OTLP Exporter | Beta |
Expand Down
2 changes: 1 addition & 1 deletion examples/metrics-advanced/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ publish = false

[dependencies]
opentelemetry = { path = "../../opentelemetry", features = ["metrics"] }
opentelemetry_sdk = { path = "../../opentelemetry-sdk", features = ["metrics", "rt-tokio"] }
opentelemetry_sdk = { path = "../../opentelemetry-sdk", features = ["spec_unstable_metrics_views", "rt-tokio"] }
opentelemetry-stdout = { path = "../../opentelemetry-stdout", features = ["metrics"] }
tokio = { workspace = true, features = ["full"] }
serde_json = { workspace = true }
2 changes: 1 addition & 1 deletion examples/metrics-advanced/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use opentelemetry::global;
use opentelemetry::Key;
use opentelemetry::KeyValue;
use opentelemetry_sdk::metrics::{
data::Temporality, Aggregation, Instrument, PeriodicReader, SdkMeterProvider, Stream,
Aggregation, Instrument, PeriodicReader, SdkMeterProvider, Stream, Temporality,
};
use opentelemetry_sdk::{runtime, Resource};
use std::error::Error;
Expand Down
5 changes: 2 additions & 3 deletions examples/metrics-basic/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use opentelemetry::global;
use opentelemetry::KeyValue;
use opentelemetry::{global, KeyValue};
use opentelemetry_sdk::metrics::{PeriodicReader, SdkMeterProvider};
use opentelemetry_sdk::{runtime, Resource};
use std::error::Error;
Expand All @@ -8,7 +7,7 @@ use std::vec;
fn init_meter_provider() -> opentelemetry_sdk::metrics::SdkMeterProvider {
let exporter = opentelemetry_stdout::MetricExporterBuilder::default()
// Build exporter using Delta Temporality (Defaults to Temporality::Cumulative)
// .with_temporality(data::Temporality::Delta)
// .with_temporality(opentelemetry_sdk::metrics::Temporality::Delta)
.build();
let reader = PeriodicReader::builder(exporter, runtime::Tokio).build();
let provider = SdkMeterProvider::builder()
Expand Down
7 changes: 7 additions & 0 deletions opentelemetry-appender-log/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,15 @@

## vNext

## 0.27.0

Released 2024-Nov-11

- Update `opentelemetry` dependency version to 0.27

- Bump MSRV to 1.70 [#2179](https://github.com/open-telemetry/opentelemetry-rust/pull/2179)
- [2193](https://github.com/open-telemetry/opentelemetry-rust/pull/2193) `opentelemetry-appender-log`: Output experimental code attributes
- **Breaking** [2291](https://github.com/open-telemetry/opentelemetry-rust/pull/2291) Rename `logs_level_enabled flag` to `spec_unstable_logs_enabled`. Please enable this updated flag if the feature is needed. This flag will be removed once the feature is stabilized in the specifications.

## v0.26.0
Released 2024-Sep-30
Expand Down
10 changes: 5 additions & 5 deletions opentelemetry-appender-log/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "opentelemetry-appender-log"
version = "0.26.0"
version = "0.27.0"
description = "An OpenTelemetry appender for the log crate"
homepage = "https://github.com/open-telemetry/opentelemetry-rust/tree/main/opentelemetry-appender-log"
repository = "https://github.com/open-telemetry/opentelemetry-rust/tree/main/opentelemetry-appender-log"
Expand All @@ -11,24 +11,24 @@ rust-version = "1.70"
edition = "2021"

[dependencies]
opentelemetry = { version = "0.26", path = "../opentelemetry", features = [
opentelemetry = { version = "0.27", path = "../opentelemetry", features = [
"logs",
] }
log = { workspace = true, features = ["kv", "std"] }
serde = { workspace = true, optional = true, features = ["std"] }
opentelemetry-semantic-conventions = { path = "../opentelemetry-semantic-conventions", optional = true, features = [
opentelemetry-semantic-conventions = { version = "0.27", path = "../opentelemetry-semantic-conventions", optional = true, features = [
"semconv_experimental",
] }

[features]
logs_level_enabled = ["opentelemetry/logs_level_enabled"]
spec_unstable_logs_enabled = ["opentelemetry/spec_unstable_logs_enabled"]
with-serde = ["log/kv_serde", "serde"]
experimental_metadata_attributes = ["dep:opentelemetry-semantic-conventions"]

[dev-dependencies]
opentelemetry_sdk = { path = "../opentelemetry-sdk", features = [
"testing",
"logs_level_enabled",
"spec_unstable_logs_enabled",
] }
opentelemetry-stdout = { path = "../opentelemetry-stdout", features = ["logs"] }
log = { workspace = true, features = ["kv_serde"] }
Expand Down
10 changes: 5 additions & 5 deletions opentelemetry-appender-log/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
//!
//! This library provides the following Cargo features:
//!
//! - `logs_level_enabled`: Allow users to control the log level.
//! - `spec_unstable_logs_enabled`: Allow users to control the log level.
//! - `with-serde`: Support complex values as attributes without stringifying them.
//!
//! [Logs Bridge API]: https://opentelemetry.io/docs/specs/otel/logs/bridge-api/
Expand Down Expand Up @@ -117,11 +117,11 @@ where
L: Logger + Send + Sync,
{
fn enabled(&self, _metadata: &Metadata) -> bool {
#[cfg(feature = "logs_level_enabled")]
#[cfg(feature = "spec_unstable_logs_enabled")]
return self
.logger
.event_enabled(severity_of_level(_metadata.level()), _metadata.target());
#[cfg(not(feature = "logs_level_enabled"))]
#[cfg(not(feature = "spec_unstable_logs_enabled"))]
true
}

Expand Down Expand Up @@ -770,9 +770,9 @@ mod tests {
// As a result of using `with_simple_exporter` while building the logger provider,
// the processor used is a `SimpleLogProcessor` which has an implementation of `event_enabled`
// that always returns true.
#[cfg(feature = "logs_level_enabled")]
#[cfg(feature = "spec_unstable_logs_enabled")]
assert!(otel_log_appender.enabled(&log::Metadata::builder().build()));
#[cfg(not(feature = "logs_level_enabled"))]
#[cfg(not(feature = "spec_unstable_logs_enabled"))]
assert!(otel_log_appender.enabled(&log::Metadata::builder().build()));
}

Expand Down
7 changes: 7 additions & 0 deletions opentelemetry-appender-tracing/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@

## vNext

## 0.27.0

Released 2024-Nov-11

- Update `opentelemetry` dependency version to 0.27

- Bump MSRV to 1.70 [#2179](https://github.com/open-telemetry/opentelemetry-rust/pull/2179)
- **Breaking** [2291](https://github.com/open-telemetry/opentelemetry-rust/pull/2291) Rename `logs_level_enabled flag` to `spec_unstable_logs_enabled`. Please enable this updated flag if the feature is needed. This flag will be removed once the feature is stabilized in the specifications.

## v0.26.0
Released 2024-Sep-30
Expand Down
8 changes: 4 additions & 4 deletions opentelemetry-appender-tracing/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "opentelemetry-appender-tracing"
version = "0.26.0"
version = "0.27.0"
edition = "2021"
description = "An OpenTelemetry log appender for the tracing crate"
homepage = "https://github.com/open-telemetry/opentelemetry-rust/tree/main/opentelemetry-appender-tracing"
Expand All @@ -12,7 +12,7 @@ rust-version = "1.70"

[dependencies]
log = { workspace = true, optional = true }
opentelemetry = { version = "0.26", path = "../opentelemetry", features = ["logs"] }
opentelemetry = { version = "0.27", path = "../opentelemetry", features = ["logs"] }
tracing = { workspace = true, features = ["std"]}
tracing-core = { workspace = true }
tracing-log = { version = "0.2", optional = true }
Expand All @@ -33,10 +33,10 @@ pprof = { version = "0.13", features = ["flamegraph", "criterion"] }

[features]
experimental_metadata_attributes = ["dep:tracing-log"]
logs_level_enabled = ["opentelemetry/logs_level_enabled"]
spec_unstable_logs_enabled = ["opentelemetry/spec_unstable_logs_enabled"]


[[bench]]
name = "logs"
harness = false
required-features = ["logs_level_enabled"]
required-features = ["spec_unstable_logs_enabled"]
2 changes: 1 addition & 1 deletion opentelemetry-appender-tracing/src/layer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ where
self.logger.emit(log_record);
}

#[cfg(feature = "logs_level_enabled")]
#[cfg(feature = "spec_unstable_logs_enabled")]
fn event_enabled(
&self,
_event: &tracing_core::Event<'_>,
Expand Down
6 changes: 6 additions & 0 deletions opentelemetry-http/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## vNext

## 0.27.0

Released 2024-Nov-08

- Update `opentelemetry` dependency version to 0.27

- Bump MSRV to 1.70 [#2179](https://github.com/open-telemetry/opentelemetry-rust/pull/2179)

## v0.26.0
Expand Down
4 changes: 2 additions & 2 deletions opentelemetry-http/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "opentelemetry-http"
version = "0.26.0"
version = "0.27.0"
description = "Helper implementations for sending HTTP requests. Uses include propagating and extracting context over http, exporting telemetry, requesting sampling strategies."
homepage = "https://github.com/open-telemetry/opentelemetry-rust"
repository = "https://github.com/open-telemetry/opentelemetry-rust"
Expand All @@ -21,6 +21,6 @@ http = { workspace = true }
http-body-util = { workspace = true, optional = true }
hyper = { workspace = true, optional = true }
hyper-util = { workspace = true, features = ["client-legacy", "http1", "http2"], optional = true }
opentelemetry = { version = "0.26", path = "../opentelemetry", features = ["trace"] }
opentelemetry = { version = "0.27", path = "../opentelemetry", features = ["trace"] }
reqwest = { workspace = true, features = ["blocking"], optional = true }
tokio = { workspace = true, features = ["time"], optional = true }
6 changes: 6 additions & 0 deletions opentelemetry-jaeger-propagator/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## vNext

## 0.27.0

Released 2024-Nov-11

- Update `opentelemetry` dependency version to 0.27

- Bump MSRV to 1.70 [#2179](https://github.com/open-telemetry/opentelemetry-rust/pull/2179)

## v0.26.0
Expand Down
4 changes: 2 additions & 2 deletions opentelemetry-jaeger-propagator/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "opentelemetry-jaeger-propagator"
version = "0.26.0"
version = "0.27.0"
description = "Jaeger propagator for OpenTelemetry"
homepage = "https://github.com/open-telemetry/opentelemetry-rust/tree/main/opentelemetry-jaeger-propagator"
repository = "https://github.com/open-telemetry/opentelemetry-rust/tree/main/opentelemetry-jaeger-propagator"
Expand All @@ -20,7 +20,7 @@ all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[dependencies]
opentelemetry = { version = "0.26", default-features = false, features = [
opentelemetry = { version = "0.27", default-features = false, features = [
"trace",
], path = "../opentelemetry" }

Expand Down
11 changes: 10 additions & 1 deletion opentelemetry-otlp/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

## vNext

## 0.27.0

Released 2024-Nov-11

- Update `opentelemetry` dependency version to 0.27
- Update `opentelemetry_sdk` dependency version to 0.27
- Update `opentelemetry-http` dependency version to 0.27
- Update `opentelemetry-proto` dependency version to 0.27

- **BREAKING**:
- ([#2217](https://github.com/open-telemetry/opentelemetry-rust/pull/2217)) **Replaced**: The `MetricsExporterBuilder` interface is modified from `with_temporality_selector` to `with_temporality` example can be seen below:
Previous Signature:
Expand All @@ -10,7 +19,7 @@
```
Updated Signature:
```rust
MetricsExporterBuilder::default().with_temporality(Temporality::Delta)
MetricsExporterBuilder::default().with_temporality(opentelemetry_sdk::metrics::Temporality::Delta)
```
- ([#2221](https://github.com/open-telemetry/opentelemetry-rust/pull/2221)) **Replaced**:
- The `opentelemetry_otlp::new_pipeline().{trace,logging,metrics}()` interface is now replaced with `{TracerProvider,SdkMeterProvider,LoggerProvider}::builder()`.
Expand Down
10 changes: 5 additions & 5 deletions opentelemetry-otlp/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "opentelemetry-otlp"
version = "0.26.0"
version = "0.27.0"
description = "Exporter for the OpenTelemetry Collector"
homepage = "https://github.com/open-telemetry/opentelemetry-rust/tree/main/opentelemetry-otlp"
repository = "https://github.com/open-telemetry/opentelemetry-rust/tree/main/opentelemetry-otlp"
Expand Down Expand Up @@ -28,10 +28,10 @@ rustdoc-args = ["--cfg", "docsrs"]
[dependencies]
async-trait = { workspace = true }
futures-core = { workspace = true }
opentelemetry = { version = "0.26", default-features = false, path = "../opentelemetry" }
opentelemetry_sdk = { version = "0.26", default-features = false, path = "../opentelemetry-sdk" }
opentelemetry-http = { version = "0.26", path = "../opentelemetry-http", optional = true }
opentelemetry-proto = { version = "0.26", path = "../opentelemetry-proto", default-features = false }
opentelemetry = { version = "0.27", default-features = false, path = "../opentelemetry" }
opentelemetry_sdk = { version = "0.27", default-features = false, path = "../opentelemetry-sdk" }
opentelemetry-http = { version = "0.27", path = "../opentelemetry-http", optional = true }
opentelemetry-proto = { version = "0.27", path = "../opentelemetry-proto", default-features = false }
tracing = {workspace = true, optional = true}

prost = { workspace = true, optional = true }
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-otlp/examples/basic-otlp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ tokio = { version = "1.0", features = ["full"] }
opentelemetry-appender-tracing = { path = "../../../opentelemetry-appender-tracing", default-features = false}
tracing = { workspace = true, features = ["std"]}
tracing-core = { workspace = true }
tracing-subscriber = { workspace = true, features = ["env-filter","registry", "std"] }
tracing-subscriber = { workspace = true, features = ["env-filter","registry", "std"] }
4 changes: 2 additions & 2 deletions opentelemetry-otlp/src/exporter/http/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ impl Default for HttpConfig {
///
/// ```
/// # #[cfg(feature="metrics")]
/// use opentelemetry_sdk::metrics::data::Temporality;
/// use opentelemetry_sdk::metrics::Temporality;
///
/// # fn main() -> Result<(), Box<dyn std::error::Error>> {
/// // Create a span exporter you can use to when configuring tracer providers
Expand Down Expand Up @@ -243,7 +243,7 @@ impl HttpExporterBuilder {
#[cfg(feature = "metrics")]
pub fn build_metrics_exporter(
mut self,
temporality: opentelemetry_sdk::metrics::data::Temporality,
temporality: opentelemetry_sdk::metrics::Temporality,
) -> opentelemetry_sdk::metrics::MetricResult<crate::MetricExporter> {
use crate::{
OTEL_EXPORTER_OTLP_METRICS_ENDPOINT, OTEL_EXPORTER_OTLP_METRICS_HEADERS,
Expand Down
4 changes: 2 additions & 2 deletions opentelemetry-otlp/src/exporter/tonic/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ impl TryFrom<Compression> for tonic::codec::CompressionEncoding {
///
/// ```no_run
/// # #[cfg(feature="metrics")]
/// use opentelemetry_sdk::metrics::data::Temporality;
/// use opentelemetry_sdk::metrics::Temporality;
///
/// # fn main() -> Result<(), Box<dyn std::error::Error>> {
/// // Create a span exporter you can use to when configuring tracer providers
Expand Down Expand Up @@ -273,7 +273,7 @@ impl TonicExporterBuilder {
#[cfg(feature = "metrics")]
pub(crate) fn build_metrics_exporter(
self,
temporality: opentelemetry_sdk::metrics::data::Temporality,
temporality: opentelemetry_sdk::metrics::Temporality,
) -> opentelemetry_sdk::metrics::MetricResult<crate::MetricExporter> {
use crate::MetricExporter;
use metrics::TonicMetricsClient;
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-otlp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
//! use opentelemetry::{global, KeyValue, trace::Tracer};
//! use opentelemetry_sdk::{trace::{self, RandomIdGenerator, Sampler}, Resource};
//! # #[cfg(feature = "metrics")]
//! use opentelemetry_sdk::metrics::data::Temporality;
//! use opentelemetry_sdk::metrics::Temporality;
//! use opentelemetry_otlp::{Protocol, WithExportConfig, WithTonicConfig};
//! use std::time::Duration;
//! # #[cfg(feature = "grpc-tonic")]
Expand Down
3 changes: 1 addition & 2 deletions opentelemetry-otlp/src/metric.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ use core::fmt;
use opentelemetry_sdk::metrics::MetricResult;

use opentelemetry_sdk::metrics::{
data::{ResourceMetrics, Temporality},
exporter::PushMetricExporter,
data::ResourceMetrics, exporter::PushMetricExporter, Temporality,
};
use std::fmt::{Debug, Formatter};

Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-otlp/tests/integration_test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ testcontainers = "0.15.0"
[target.'cfg(unix)'.dependencies]
opentelemetry-appender-log = { path = "../../../opentelemetry-appender-log", default-features = false}
opentelemetry-otlp = { path = "../../../opentelemetry-otlp", features = ["tonic", "metrics", "logs"] }
opentelemetry-semantic-conventions = { path = "../../../opentelemetry-semantic-conventions" }
opentelemetry-semantic-conventions = { path = "../../../opentelemetry-semantic-conventions" }
7 changes: 7 additions & 0 deletions opentelemetry-proto/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

## vNext

## 0.27.0

Released 2024-Nov-11

- Update `opentelemetry` dependency version to 0.27
- Update `opentelemetry_sdk` dependency version to 0.27

## v0.26.1

- Require tonic 0.12.3 to match generated gRPC code [#2168](https://github.com/open-telemetry/opentelemetry-rust/pull/2168)
Expand Down
Loading

0 comments on commit 9984bec

Please sign in to comment.