Skip to content
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

build: upgrade for opentelemetry 0.28 #61

Merged
merged 4 commits into from
Feb 11, 2025
Merged
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 fastrace-opentelemetry/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

## v0.9.0

- Upgrade opentelemtry to 0.28.0.

## v0.8.1

- Reduce dependencies to futures 0.3.
Expand Down
8 changes: 4 additions & 4 deletions fastrace-opentelemetry/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "fastrace-opentelemetry"
version = "0.8.1"
version = "0.9.0"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll call a new release once this patch is merged.


categories = ["development-tools::debugging"]
description = "Opentelemetry reporter for fastrace"
Expand All @@ -16,9 +16,9 @@ rust-version.workspace = true
[dependencies]
fastrace = { workspace = true }
log = { workspace = true }
opentelemetry = { version = "0.27", features = ["trace"] }
opentelemetry_sdk = { version = "0.27", features = ["trace"] }
opentelemetry = { version = "0.28", default-features = false, features = ["trace"] }
opentelemetry_sdk = { version = "0.28", default-features = false, features = ["trace"] }
pollster = { version = "0.4.0" }

[dev-dependencies]
opentelemetry-otlp = { version = "0.27", features = ["trace"] }
opentelemetry-otlp = { version = "0.28", features = ["trace"] }
8 changes: 6 additions & 2 deletions fastrace-opentelemetry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
```toml
[dependencies]
fastrace = "0.7"
fastrace-opentelemetry = "0.7"
fastrace-opentelemetry = "0.9"
```

## Setup OpenTelemetry Collector
Expand Down Expand Up @@ -62,7 +62,11 @@ let reporter = OpenTelemetryReporter::new(
.build()
.expect("initialize oltp exporter"),
SpanKind::Server,
Cow::Owned(Resource::new([KeyValue::new("service.name", "asynchronous")])),
Cow::Owned(
Resource::builder()
.with_attributes([KeyValue::new("service.name", "asynchronous")])
.build()
),
InstrumentationScope::builder("example-crate").with_version(env!("CARGO_PKG_VERSION")).build(),
);
fastrace::set_reporter(reporter, Config::default());
Expand Down
4 changes: 2 additions & 2 deletions fastrace-opentelemetry/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ use opentelemetry::trace::Status;
use opentelemetry::trace::TraceFlags;
use opentelemetry::trace::TraceState;
use opentelemetry_sdk::Resource;
use opentelemetry_sdk::export::trace::SpanData;
use opentelemetry_sdk::export::trace::SpanExporter;
use opentelemetry_sdk::trace::SpanData;
use opentelemetry_sdk::trace::SpanEvents;
use opentelemetry_sdk::trace::SpanExporter;
use opentelemetry_sdk::trace::SpanLinks;

/// [OpenTelemetry](https://github.com/open-telemetry/opentelemetry-rust) reporter for `fastrace`.
Expand Down
8 changes: 4 additions & 4 deletions fastrace/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ log = { workspace = true }
logcall = "0.1"
logforth = { version = "0.19.2", features = ["fastrace"] }
mockall = "0.13"
opentelemetry = { version = "0.27", features = ["trace"] }
opentelemetry-otlp = { version = "0.27", features = ["trace"] }
opentelemetry_sdk = { version = "0.27", features = ["trace"] }
opentelemetry = { version = "0.28", features = ["trace"] }
opentelemetry-otlp = { version = "0.28", features = ["trace", "grpc-tonic"] }
opentelemetry_sdk = { version = "0.28", features = ["trace"] }
pollster = { version = "0.4.0" }
rand = "0.9"
rustracing = "0.6"
Expand All @@ -56,7 +56,7 @@ tokio = { version = "1.38", features = [
"rt-multi-thread",
] }
tracing = "0.1"
tracing-opentelemetry = "0.27"
tracing-opentelemetry = "0.28.0"
tracing-subscriber = "0.3"

[[bench]]
Expand Down
11 changes: 8 additions & 3 deletions fastrace/examples/asynchronous.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,14 @@ impl ReportAll {
.build()
.expect("initialize oltp exporter"),
opentelemetry::trace::SpanKind::Server,
Cow::Owned(opentelemetry_sdk::Resource::new([
opentelemetry::KeyValue::new("service.name", "asynchronous(opentelemetry)"),
])),
Cow::Owned(
opentelemetry_sdk::Resource::builder()
.with_attributes([opentelemetry::KeyValue::new(
"service.name",
"asynchronous(opentelemetry)",
)])
.build(),
),
opentelemetry::InstrumentationScope::builder("example-crate")
.with_version(env!("CARGO_PKG_VERSION"))
.build(),
Expand Down
11 changes: 8 additions & 3 deletions fastrace/examples/synchronous.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,14 @@ impl ReportAll {
.build()
.expect("initialize oltp exporter"),
opentelemetry::trace::SpanKind::Server,
Cow::Owned(opentelemetry_sdk::Resource::new([
opentelemetry::KeyValue::new("service.name", "synchronous(opentelemetry)"),
])),
Cow::Owned(
opentelemetry_sdk::Resource::builder()
.with_attributes([opentelemetry::KeyValue::new(
"service.name",
"synchronous(opentelemetry)",
)])
.build(),
),
opentelemetry::InstrumentationScope::builder("example-crate")
.with_version(env!("CARGO_PKG_VERSION"))
.build(),
Expand Down
Loading