Skip to content

Commit

Permalink
Merge branch 'main' into derive
Browse files Browse the repository at this point in the history
  • Loading branch information
lalitb authored Oct 27, 2024
2 parents 7d668a4 + fe3b916 commit 058a70f
Show file tree
Hide file tree
Showing 31 changed files with 254 additions and 80 deletions.
28 changes: 22 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
sudo rm -rf /usr/local/lib/android
sudo rm -rf /usr/share/dotnet
df -h
- uses: actions/checkout@v1
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions-rs/toolchain@v1
Expand All @@ -35,7 +35,7 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions-rs/toolchain@v1
Expand All @@ -54,7 +54,7 @@ jobs:
# msrv:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v1
# - uses: actions/checkout@v4
# with:
# submodules: true
# - uses: actions-rs/toolchain@v1
Expand All @@ -73,15 +73,15 @@ jobs:
runs-on: ubuntu-latest
continue-on-error: true # Prevent sudden announcement of a new advisory from failing ci
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v1
with:
command: check advisories
docs:
continue-on-error: true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
Expand All @@ -97,7 +97,7 @@ jobs:
continue-on-error: true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions-rs/toolchain@v1
Expand All @@ -117,3 +117,19 @@ jobs:
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
cargo-machete:
continue-on-error: true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: taiki-e/install-action@v2
with:
tool: cargo-machete
- name: cargo machete
run: cargo machete
14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ resolver = "2"
debug = 1

[workspace.dependencies]
opentelemetry = "0.25"
opentelemetry-appender-tracing = "0.25"
opentelemetry-http = "0.25"
opentelemetry-proto = { version = "0.25", default-features = false }
opentelemetry_sdk = { version = "0.25", default-features = false }
opentelemetry-stdout = "0.25"
opentelemetry-semantic-conventions = "0.25"
opentelemetry = "0.26"
opentelemetry-appender-tracing = "0.26"
opentelemetry-http = "0.26"
opentelemetry-proto = { version = "0.26", default-features = false }
opentelemetry_sdk = { version = "0.26", default-features = false }
opentelemetry-stdout = "0.26"
opentelemetry-semantic-conventions = { version = "0.26", features = ["semconv_experimental"] }
8 changes: 8 additions & 0 deletions opentelemetry-aws/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## vNext

## v0.14.0

### Changed

- Bump opentelemetry and opentelemetry_sdk versions to 0.26.0

## v0.13.0

### Added
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-aws/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "opentelemetry-aws"
version = "0.13.0"
version = "0.14.0"
description = "AWS exporters and propagators for OpenTelemetry"
homepage = "https://github.com/open-telemetry/opentelemetry-rust-contrib/tree/main/opentelemetry-aws"
repository = "https://github.com/open-telemetry/opentelemetry-rust-contrib/tree/main/opentelemetry-aws"
Expand Down
7 changes: 7 additions & 0 deletions opentelemetry-contrib/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

## vNext

## v0.18.0

### Changed

- Bump opentelemetry and opentelemetry_sdk versions to 0.26
- Bump opentelemetry-semantic-conventions version to 0.26

## v0.17.0

### Changed
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-contrib/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "opentelemetry-contrib"
version = "0.17.0"
version = "0.18.0"
description = "Rust contrib repo for OpenTelemetry"
homepage = "https://github.com/open-telemetry/opentelemetry-rust-contrib/tree/main/opentelemetry-contrib"
repository = "https://github.com/open-telemetry/opentelemetry-rust-contrib/tree/main/opentelemetry-contrib"
Expand Down
9 changes: 4 additions & 5 deletions opentelemetry-datadog/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,15 @@ intern-std = []
[dependencies]
indexmap = "2.0"
once_cell = "1.12"
opentelemetry = { version = "0.24", features = ["trace"] }
opentelemetry_sdk = { version = "0.24", features = ["trace"] }
opentelemetry-http = { version = "0.13" }
opentelemetry = { workspace = true }
opentelemetry_sdk = { workspace = true, features = ["trace"] }
opentelemetry-http = { workspace = true }
opentelemetry-semantic-conventions = { workspace = true }
rmp = "0.8"
url = "2.2"
reqwest = { version = "0.12", default-features = false, optional = true }
surf = { version = "2.0", default-features = false, optional = true }
thiserror = "1.0"
itertools = "0.11"
http = "1"
futures-core = "0.3"
ryu = "1"
Expand All @@ -48,7 +47,7 @@ async-trait = "0.1"
base64 = "0.13"
bytes = "1"
futures-util = { version = "0.3", default-features = false, features = ["io"] }
opentelemetry_sdk = { version = "0.24", features = ["trace", "testing"] }
opentelemetry_sdk = { workspace = true, features = ["trace", "testing"] }
criterion = "0.5"
rand = "0.8"
hyper = "1"
Expand Down
29 changes: 22 additions & 7 deletions opentelemetry-datadog/examples/agent_sampling.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use opentelemetry::{
global::{self, shutdown_tracer_provider},
trace::{SamplingResult, Span, TraceContextExt, Tracer},
Key,
Key, KeyValue, Value,
};
use opentelemetry_datadog::{new_pipeline, ApiVersion, DatadogTraceStateBuilder};
use opentelemetry_sdk::trace::{self, RandomIdGenerator, ShouldSample};
Expand All @@ -11,8 +11,14 @@ use std::time::Duration;
fn bar() {
let tracer = global::tracer("component-bar");
let mut span = tracer.start("bar");
span.set_attribute(Key::new("span.type").string("sql"));
span.set_attribute(Key::new("sql.query").string("SELECT * FROM table"));
span.set_attribute(KeyValue::new(
Key::new("span.type"),
Value::String("sql".into()),
));
span.set_attribute(KeyValue::new(
Key::new("sql.query"),
Value::String("SELECT * FROM table".into()),
));
thread::sleep(Duration::from_millis(6));
span.end()
}
Expand Down Expand Up @@ -62,10 +68,19 @@ fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync + 'static>> {

tracer.in_span("foo", |cx| {
let span = cx.span();
span.set_attribute(Key::new("span.type").string("web"));
span.set_attribute(Key::new("http.url").string("http://localhost:8080/foo"));
span.set_attribute(Key::new("http.method").string("GET"));
span.set_attribute(Key::new("http.status_code").i64(200));
span.set_attribute(KeyValue::new(
Key::new("span.type"),
Value::String("web".into()),
));
span.set_attribute(KeyValue::new(
Key::new("http.url"),
Value::String("http://localhost:8080/foo".into()),
));
span.set_attribute(KeyValue::new(
Key::new("http.method"),
Value::String("GET".into()),
));
span.set_attribute(KeyValue::new(Key::new("http.status_code"), Value::I64(200)));

thread::sleep(Duration::from_millis(6));
bar();
Expand Down
29 changes: 22 additions & 7 deletions opentelemetry-datadog/examples/datadog.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use opentelemetry::{
global::{self, shutdown_tracer_provider},
trace::{Span, TraceContextExt, Tracer},
Key,
Key, KeyValue, Value,
};
use opentelemetry_datadog::{new_pipeline, ApiVersion};
use std::thread;
Expand All @@ -10,8 +10,14 @@ use std::time::Duration;
fn bar() {
let tracer = global::tracer("component-bar");
let mut span = tracer.start("bar");
span.set_attribute(Key::new("span.type").string("sql"));
span.set_attribute(Key::new("sql.query").string("SELECT * FROM table"));
span.set_attribute(KeyValue::new(
Key::new("span.type"),
Value::String("sql".into()),
));
span.set_attribute(KeyValue::new(
Key::new("sql.query"),
Value::String("SELECT * FROM table".into()),
));
thread::sleep(Duration::from_millis(6));
span.end()
}
Expand All @@ -24,10 +30,19 @@ fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync + 'static>> {

tracer.in_span("foo", |cx| {
let span = cx.span();
span.set_attribute(Key::new("span.type").string("web"));
span.set_attribute(Key::new("http.url").string("http://localhost:8080/foo"));
span.set_attribute(Key::new("http.method").string("GET"));
span.set_attribute(Key::new("http.status_code").i64(200));
span.set_attribute(KeyValue::new(
Key::new("span.type"),
Value::String("web".into()),
));
span.set_attribute(KeyValue::new(
Key::new("http.url"),
Value::String("http://localhost:8080/foo".into()),
));
span.set_attribute(KeyValue::new(
Key::new("http.method"),
Value::String("GET".into()),
));
span.set_attribute(KeyValue::new(Key::new("http.status_code"), Value::I64(200)));

thread::sleep(Duration::from_millis(6));
bar();
Expand Down
6 changes: 6 additions & 0 deletions opentelemetry-etw-logs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## vNext

## v0.5.0

### Changed

- Bump opentelemetry and opentelemetry_sdk versions to 0.26

## v0.4.0

### Changed
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-etw-logs/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "opentelemetry-etw-logs"
description = "OpenTelemetry logs exporter to ETW (Event Tracing for Windows)"
version = "0.4.0"
version = "0.5.0"
edition = "2021"
homepage = "https://github.com/open-telemetry/opentelemetry-rust-contrib/tree/main/opentelemetry-etw-logs"
repository = "https://github.com/open-telemetry/opentelemetry-rust-contrib/tree/main/opentelemetry-etw-logs"
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-etw-logs/src/logs/exporter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ impl ETWExporter {
event: &mut tld::EventBuilder,
log_record: &'a opentelemetry_sdk::logs::LogRecord,
field_tag: u32,
) -> (Option<i64>, Option<&str>) {
) -> (Option<i64>, Option<&'a str>) {
//populate CS PartC
let mut event_id: Option<i64> = None;
let mut event_name: Option<&str> = None;
Expand Down
8 changes: 8 additions & 0 deletions opentelemetry-etw-metrics/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

## vNext

## v0.5.0

### Changed

- Bump opentelemetry and opentelemetry_sdk versions to 0.26
- Bump opentelemetry-proto version to 0.26
- Bump rust msrv to v1.71.1

## v0.4.0

- Improved logging when ETW write fails due to size limit being hit.
Expand Down
10 changes: 5 additions & 5 deletions opentelemetry-etw-metrics/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
[package]
name = "opentelemetry-etw-metrics"
version = "0.4.0"
version = "0.5.0"
edition = "2021"
description = "OpenTelemetry metrics exporter to ETW (Event Tracing for Windows)"
homepage = "https://github.com/open-telemetry/opentelemetry-rust-contrib/tree/main/opentelemetry-etw-metrics"
repository = "https://github.com/open-telemetry/opentelemetry-rust-contrib/tree/main/opentelemetry-etw-metrics"
readme = "README.md"
keywords = ["opentelemetry", "metrics", "etw"]
license = "Apache-2.0"
rust-version = "1.65"
rust-version = "1.71.1"

[dependencies]
opentelemetry = { version = "0.25", features = ["metrics"] }
opentelemetry_sdk = { version = "0.25", features = ["metrics", "rt-tokio"] }
opentelemetry-proto = { version = "0.25", features = ["gen-tonic", "metrics"] }
opentelemetry = { workspace = true, features = ["metrics"] }
opentelemetry_sdk = { workspace = true, features = ["metrics", "rt-tokio"] }
opentelemetry-proto = { workspace = true, features = ["gen-tonic", "metrics"] }
async-trait = "0.1"
prost = "0.13"
tracelogging = "1.2.1"
Expand Down
10 changes: 2 additions & 8 deletions opentelemetry-etw-metrics/src/exporter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ use opentelemetry_sdk::metrics::{
ScopeMetrics, Temporality,
},
exporter::PushMetricsExporter,
reader::{AggregationSelector, DefaultAggregationSelector, TemporalitySelector},
Aggregation, InstrumentKind,
reader::TemporalitySelector,
InstrumentKind,
};
use prost::Message;

Expand Down Expand Up @@ -51,12 +51,6 @@ impl TemporalitySelector for MetricsExporter {
}
}

impl AggregationSelector for MetricsExporter {
fn aggregation(&self, kind: InstrumentKind) -> Aggregation {
DefaultAggregationSelector::new().aggregation(kind)
}
}

impl Debug for MetricsExporter {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
f.write_str("ETW metrics exporter")
Expand Down
7 changes: 7 additions & 0 deletions opentelemetry-resource-detectors/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

## vNext

## v0.5.0

### Changed

- Bump opentelemetry and opentelemetry_sdk versions to 0.26
- Bump opentelemetry-semantic-conventions version to 0.26

## v0.4.0

### Changed
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-resource-detectors/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "opentelemetry-resource-detectors"
version = "0.4.0"
version = "0.5.0"
edition = "2021"
description = "A collection of community supported resource detectors for OpenTelemetry"
homepage = "https://github.com/open-telemetry/opentelemetry-rust-contrib/tree/main/opentelemetry-resource-detectors"
Expand Down
Loading

0 comments on commit 058a70f

Please sign in to comment.