Skip to content

Commit dc0257d

Browse files
authored
Merge branch 'main' into cijothomas/simplelog-static
2 parents c41d326 + a3c469b commit dc0257d

File tree

41 files changed

+514
-207
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+514
-207
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ jobs:
2727
- rust: stable
2828
os: actuated-arm64-4cpu-16gb
2929
runs-on: ${{ matrix.os }}
30+
continue-on-error: ${{ matrix.rust == 'beta' }}
3031
steps:
3132
- name: Free disk space
3233
if: ${{ matrix.os == 'ubuntu-latest'}}

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,19 @@ observability tools.
2424

2525
## Project Status
2626

27+
The table below summarizes the overall status of each component. Some components
28+
include unstable features, which are documented in their respective crate
29+
documentation.
30+
2731
| Signal/Component | Overall Status |
2832
| -------------------- | ------------------ |
2933
| Logs-API | RC* |
3034
| Logs-SDK | Beta |
3135
| Logs-OTLP Exporter | Beta |
3236
| Logs-Appender-Tracing | Beta |
3337
| Metrics-API | RC |
34-
| Metrics-SDK | Beta |
35-
| Metrics-OTLP Exporter | Beta |
38+
| Metrics-SDK | Beta |
39+
| Metrics-OTLP Exporter | Beta |
3640
| Traces-API | Beta |
3741
| Traces-SDK | Beta |
3842
| Traces-OTLP Exporter | Beta |

examples/metrics-basic/Cargo.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,9 @@ license = "Apache-2.0"
66
publish = false
77

88
[dependencies]
9-
opentelemetry = { path = "../../opentelemetry", features = ["metrics", "otel_unstable"] }
9+
opentelemetry = { path = "../../opentelemetry", features = ["metrics"] }
1010
opentelemetry_sdk = { path = "../../opentelemetry-sdk", features = ["metrics", "rt-tokio"] }
1111
opentelemetry-stdout = { path = "../../opentelemetry-stdout", features = ["metrics"]}
1212
tokio = { workspace = true, features = ["full"] }
1313
serde_json = { workspace = true }
1414

15-
[features]
16-
default = ["otel_unstable"]
17-
otel_unstable = ["opentelemetry/otel_unstable"]

examples/self-diagnostics/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ opentelemetry-stdout = { path = "../../opentelemetry-stdout"}
1212
tokio = { workspace = true, features = ["full"] }
1313
tracing = { workspace = true, features = ["std"]}
1414
tracing-core = { workspace = true }
15-
tracing-subscriber = { version = "0.3.18", features = ["env-filter","registry", "std"]}
15+
tracing-subscriber = { workspace = true, features = ["env-filter","registry", "std", "fmt"]}

examples/self-diagnostics/src/main.rs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use opentelemetry::global;
22
use opentelemetry::KeyValue;
33
use opentelemetry_sdk::metrics::PeriodicReader;
4+
use opentelemetry_sdk::Resource;
45
use std::error::Error;
56
use tracing::info;
67
use tracing_subscriber::fmt;
@@ -13,6 +14,10 @@ fn init_meter_provider() -> opentelemetry_sdk::metrics::SdkMeterProvider {
1314
let reader = PeriodicReader::builder(exporter, opentelemetry_sdk::runtime::Tokio).build();
1415

1516
let provider = opentelemetry_sdk::metrics::SdkMeterProvider::builder()
17+
.with_resource(Resource::new([KeyValue::new(
18+
"service.name",
19+
"self-diagnostics-example",
20+
)]))
1621
.with_reader(reader)
1722
.build();
1823

@@ -26,7 +31,7 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync + 'static>> {
2631
// OpenTelemetry uses `tracing` crate for its internal logging. Unless a
2732
// tracing subscriber is set, the logs will be discarded. In this example,
2833
// we configure a `tracing` subscriber to:
29-
// 1. Print logs of level INFO or higher to stdout using tracing's fmt layer.
34+
// 1. Print logs of level DEBUG or higher to stdout using tracing's fmt layer.
3035
// 2. Filter logs from OpenTelemetry's dependencies (like tonic, hyper,
3136
// reqwest etc. which are commonly used by the OTLP exporter) to only print
3237
// ERROR-level logs. This filtering helps reduce repetitive log messages
@@ -39,7 +44,7 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync + 'static>> {
3944
// Hence, one may use "add_directive("opentelemetry=off".parse().unwrap())"
4045
// to turn off all logs from OpenTelemetry.
4146

42-
let filter = EnvFilter::new("info")
47+
let filter = EnvFilter::new("debug")
4348
.add_directive("hyper=error".parse().unwrap())
4449
.add_directive("tonic=error".parse().unwrap())
4550
.add_directive("h2=error".parse().unwrap())
@@ -54,11 +59,14 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync + 'static>> {
5459
info!("Starting self-diagnostics example");
5560

5661
let meter = global::meter("example");
57-
// Create a counter using an invalid name to trigger
58-
// internal log about the same.
59-
let counter = meter.u64_counter("my_counter with_space").build();
62+
let counter = meter.u64_counter("my_counter").build();
6063
counter.add(10, &[KeyValue::new("key", "value")]);
6164

65+
let _observable_counter = meter
66+
.u64_observable_counter("my_observable_counter")
67+
.with_callback(|observer| observer.observe(10, &[KeyValue::new("key", "value")]))
68+
.build();
69+
6270
meter_provider.shutdown()?;
6371
info!("Shutdown complete. Bye!");
6472
Ok(())

opentelemetry-appender-tracing/src/layer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ impl<'a, LR: LogRecord> EventVisitor<'a, LR> {
6969
}
7070
}
7171

72-
impl<'a, LR: LogRecord> tracing::field::Visit for EventVisitor<'a, LR> {
72+
impl<LR: LogRecord> tracing::field::Visit for EventVisitor<'_, LR> {
7373
fn record_debug(&mut self, field: &tracing::field::Field, value: &dyn std::fmt::Debug) {
7474
#[cfg(feature = "experimental_metadata_attributes")]
7575
if is_duplicated_metadata(field.name()) {

opentelemetry-http/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use opentelemetry::propagation::{Extractor, Injector};
1313
/// for example usage.
1414
pub struct HeaderInjector<'a>(pub &'a mut http::HeaderMap);
1515

16-
impl<'a> Injector for HeaderInjector<'a> {
16+
impl Injector for HeaderInjector<'_> {
1717
/// Set a key and value in the HeaderMap. Does nothing if the key or value are not valid inputs.
1818
fn set(&mut self, key: &str, value: String) {
1919
if let Ok(name) = http::header::HeaderName::from_bytes(key.as_bytes()) {
@@ -30,7 +30,7 @@ impl<'a> Injector for HeaderInjector<'a> {
3030
/// for example usage.
3131
pub struct HeaderExtractor<'a>(pub &'a http::HeaderMap);
3232

33-
impl<'a> Extractor for HeaderExtractor<'a> {
33+
impl Extractor for HeaderExtractor<'_> {
3434
/// Get a value for a key from the HeaderMap. If the value is not valid ASCII, returns None.
3535
fn get(&self, key: &str) -> Option<&str> {
3636
self.0.get(key).and_then(|value| value.to_str().ok())

opentelemetry-sdk/CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## vNext
44

5+
## 0.27.1
6+
7+
Released 2024-Nov-27
8+
59
- **DEPRECATED**:
610
- `trace::Config` methods are moving onto `TracerProvider` Builder to be consistent with other signals. See https://github.com/open-telemetry/opentelemetry-rust/pull/2303 for migration guide.
711
`trace::Config` is scheduled to be removed from public API in `v0.28.0`.
@@ -25,6 +29,19 @@
2529
- Bug fix: Empty Logger names are retained as-is instead of replacing with
2630
"rust.opentelemetry.io/sdk/logger"
2731
[#2316](https://github.com/open-telemetry/opentelemetry-rust/pull/2316)
32+
33+
- `Logger::provider`: This method is deprecated as of version `0.27.1`. To be removed in `0.28.0`.
34+
- `Logger::instrumentation_scope`: This method is deprecated as of version `0.27.1`. To be removed in `0.28.0`
35+
Migration Guidance:
36+
- These methods are intended for log appenders. Keep the clone of the provider handle, instead of depending on above methods.
37+
38+
39+
- **Bug Fix:** Validates the `with_boundaries` bucket boundaries used in
40+
Histograms. The boundaries provided by the user must not contain `f64::NAN`,
41+
`f64::INFINITY` or `f64::NEG_INFINITY` and must be sorted in strictly
42+
increasing order, and contain no duplicates. Instruments will not record
43+
measurements if the boundaries are invalid.
44+
[#2351](https://github.com/open-telemetry/opentelemetry-rust/pull/2351)
2845

2946
## 0.27.0
3047

opentelemetry-sdk/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "opentelemetry_sdk"
3-
version = "0.27.0"
3+
version = "0.27.1"
44
description = "The SDK for the OpenTelemetry metrics collection and distributed tracing framework"
55
homepage = "https://github.com/open-telemetry/opentelemetry-rust"
66
repository = "https://github.com/open-telemetry/opentelemetry-rust"
@@ -17,7 +17,6 @@ async-trait = { workspace = true, optional = true }
1717
futures-channel = "0.3"
1818
futures-executor = { workspace = true }
1919
futures-util = { workspace = true, features = ["std", "sink", "async-await-macro"] }
20-
once_cell = { workspace = true }
2120
percent-encoding = { version = "2.0", optional = true }
2221
rand = { workspace = true, features = ["std", "std_rng","small_rng"], optional = true }
2322
glob = { version = "0.3.1", optional =true}

opentelemetry-sdk/src/export/logs/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ impl<'a> LogBatch<'a> {
3939
///
4040
/// Note - this is not a public function, and should not be used directly. This would be
4141
/// made private in the future.
42-
4342
pub fn new(data: &'a [(&'a LogRecord, &'a InstrumentationScope)]) -> LogBatch<'a> {
4443
LogBatch { data }
4544
}

0 commit comments

Comments
 (0)