Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
lalitb authored Feb 25, 2025
2 parents 6c13684 + 29eda05 commit 651cc41
Show file tree
Hide file tree
Showing 28 changed files with 143 additions and 93 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/pr_naming.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: PR Conventional Commit Validation

on:
pull_request:
types: [opened, synchronize, reopened, edited]

jobs:
validate-pr-title:
runs-on: ubuntu-latest
steps:
- name: PR Conventional Commit Validation
uses: ytanikin/pr-conventional-commits@1.4.0
with:
task_types: '["build","chore","ci","docs","feat","fix","perf","refactor","revert","test"]'
add_label: 'false'
5 changes: 5 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ Open a pull request against the main
[opentelemetry-rust](https://github.com/open-telemetry/opentelemetry-rust)
repo.

Your pull request should be named according to the
[conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) standard. This ensures that
when the PR is squashed into `main`, the resulting commit message is consistent and makes it easier
for us to generate a changelog standard.

> **Note**
> It is recommended to run [pre-commit script](scripts/precommit.sh) to catch any issues locally.
Expand Down
25 changes: 25 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,31 @@ tracing = { version = ">=0.1.40", default-features = false }
tracing-core = { version = ">=0.1.33", default-features = false }
tracing-subscriber = { version = "0.3", default-features = false }
url = { version = "2.5", default-features = false }
anyhow = "1.0.94"
base64 = "0.22.1"
chrono = { version = "0.4.34", default-features = false }
ctor = "0.2.9"
ctrlc = "3.2.5"
futures-channel = "0.3"
futures-sink = "0.3"
glob = "0.3.1"
hex = "0.4.3"
lazy_static = "1.4.0"
num-format = "0.4.4"
num_cpus = "1.15.0"
opentelemetry-appender-tracing = { path = "opentelemetry-appender-tracing", default-features = false }
opentelemetry-otlp = { path = "opentelemetry-otlp" }
opentelemetry-stdout = { path = "opentelemetry-stdout" }
percent-encoding = "2.0"
rstest = "0.23.0"
schemars = "0.8"
sysinfo = "0.32"
tempfile = "3.3.0"
testcontainers = "0.23.1"
tracing-log = "0.2"
tracing-opentelemetry = "0.29"
typed-builder = "0.20"
uuid = "1.3"

# Aviod use of crates.io version of these crates through the tracing-opentelemetry dependencies
[patch.crates-io]
Expand Down
4 changes: 2 additions & 2 deletions examples/logs-basic/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ publish = false

[dependencies]
opentelemetry_sdk = { path = "../../opentelemetry-sdk", features = ["logs"] }
opentelemetry-stdout = { path = "../../opentelemetry-stdout", features = ["logs"]}
opentelemetry-appender-tracing = { path = "../../opentelemetry-appender-tracing", default-features = false}
opentelemetry-stdout = { workspace = true, features = ["logs"] }
opentelemetry-appender-tracing = { workspace = true }
tracing = { workspace = true, features = ["std"]}
tracing-subscriber = { workspace = true, features = ["env-filter","registry", "std", "fmt"] }
2 changes: 1 addition & 1 deletion examples/metrics-advanced/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ publish = false
[dependencies]
opentelemetry = { path = "../../opentelemetry", features = ["metrics"] }
opentelemetry_sdk = { path = "../../opentelemetry-sdk", features = ["spec_unstable_metrics_views", "rt-tokio"] }
opentelemetry-stdout = { path = "../../opentelemetry-stdout", features = ["metrics"] }
opentelemetry-stdout = { workspace = true, features = ["metrics"] }
tokio = { workspace = true, features = ["full"] }
2 changes: 1 addition & 1 deletion examples/metrics-basic/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ publish = false
[dependencies]
opentelemetry = { path = "../../opentelemetry", features = ["metrics"] }
opentelemetry_sdk = { path = "../../opentelemetry-sdk", features = ["metrics", "rt-tokio"] }
opentelemetry-stdout = { path = "../../opentelemetry-stdout", features = ["metrics"]}
opentelemetry-stdout = { workspace = true, features = ["metrics"] }
tokio = { workspace = true, features = ["full"] }

2 changes: 1 addition & 1 deletion examples/tracing-grpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ path = "src/client.rs"
[dependencies]
opentelemetry = { path = "../../opentelemetry" }
opentelemetry_sdk = { path = "../../opentelemetry-sdk", features = ["rt-tokio"] }
opentelemetry-stdout = { path = "../../opentelemetry-stdout", features = ["trace"] }
opentelemetry-stdout = { workspace = true, features = ["trace"] }
prost = { workspace = true }
tokio = { workspace = true, features = ["full"] }
tonic = { workspace = true, features = ["server"] }
Expand Down
2 changes: 1 addition & 1 deletion examples/tracing-http-propagator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ tokio = { workspace = true, features = ["full"] }
opentelemetry = { path = "../../opentelemetry" }
opentelemetry_sdk = { path = "../../opentelemetry-sdk" }
opentelemetry-http = { path = "../../opentelemetry-http" }
opentelemetry-stdout = { path = "../../opentelemetry-stdout", features = ["trace"] }
opentelemetry-stdout = { workspace = true, features = ["trace"] }
opentelemetry-semantic-conventions = { path = "../../opentelemetry-semantic-conventions" }
2 changes: 1 addition & 1 deletion examples/tracing-jaeger/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ publish = false
[dependencies]
opentelemetry = { path = "../../opentelemetry" }
opentelemetry_sdk = { path = "../../opentelemetry-sdk", features = ["rt-tokio"] }
opentelemetry-otlp = { path = "../../opentelemetry-otlp", features = ["tonic"] }
opentelemetry-otlp = { workspace = true, features = ["tonic"] }
tokio = { workspace = true, features = ["full"] }
2 changes: 1 addition & 1 deletion opentelemetry-appender-log/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ opentelemetry_sdk = { path = "../opentelemetry-sdk", features = [
"testing",
"spec_unstable_logs_enabled",
] }
opentelemetry-stdout = { path = "../opentelemetry-stdout", features = ["logs"] }
opentelemetry-stdout = { workspace = true, features = ["logs"] }
log = { workspace = true, features = ["kv_serde"] }
tokio = { workspace = true }
serde = { workspace = true, features = ["std", "derive"] }
Expand Down
11 changes: 7 additions & 4 deletions opentelemetry-appender-tracing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ log = { workspace = true, optional = true }
opentelemetry = { version = "0.28", path = "../opentelemetry", features = ["logs"] }
tracing = { workspace = true, features = ["std"]}
tracing-core = { workspace = true }
tracing-log = { version = "0.2", optional = true }
tracing-log = { workspace = true, optional = true }
tracing-subscriber = { workspace = true, features = ["registry", "std"] }
tracing-opentelemetry = { version = "0.29", optional = true }
tracing-opentelemetry = { workspace = true, optional = true }

[dev-dependencies]
log = { workspace = true }
opentelemetry-stdout = { path = "../opentelemetry-stdout", features = ["logs"] }
opentelemetry-stdout = { workspace = true, features = ["logs"] }
opentelemetry_sdk = { path = "../opentelemetry-sdk", features = ["logs", "testing"] }
tracing = { workspace = true, features = ["std"]}
tracing-subscriber = { workspace = true, features = ["env-filter","registry", "std", "fmt"] }
tracing-log = "0.2"
tracing-log = { workspace = true }
criterion = { workspace = true }
tokio = { workspace = true, features = ["full"]}

Expand All @@ -44,5 +44,8 @@ name = "logs"
harness = false
required-features = ["spec_unstable_logs_enabled"]

[lib]
bench = false

[lints]
workspace = true
7 changes: 4 additions & 3 deletions opentelemetry-otlp/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## vNext

- The `OTEL_EXPORTER_OTLP_TIMEOUT`, `OTEL_EXPORTER_OTLP_TRACES_TIMEOUT`, `OTEL_EXPORTER_OTLP_METRICS_TIMEOUT` and `OTEL_EXPORTER_OTLP_LOGS_TIMEOUT` are changed from seconds to miliseconds.
- Fixed `.with_headers()` in `HttpExporterBuilder` to correctly support multiple key/value pairs. [#2699](https://github.com/open-telemetry/opentelemetry-rust/pull/2699)

## 0.28.0

Expand Down Expand Up @@ -41,7 +42,7 @@ Released 2024-Nov-11
- Update `opentelemetry-http` dependency version to 0.27
- Update `opentelemetry-proto` dependency version to 0.27

- **BREAKING**:
- **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:
```rust
Expand Down Expand Up @@ -88,9 +89,9 @@ Released 2024-Nov-11
- `MetricsExporterBuilder` -> `MetricExporterBuilder`

- [#2263](https://github.com/open-telemetry/opentelemetry-rust/pull/2263)
Support `hyper` client for opentelemetry-otlp. This can be enabled using flag `hyper-client`.
Support `hyper` client for opentelemetry-otlp. This can be enabled using flag `hyper-client`.
Refer example: https://github.com/open-telemetry/opentelemetry-rust/tree/main/opentelemetry-otlp/examples/basic-otlp-http

## v0.26.0
Released 2024-Sep-30

Expand Down
4 changes: 2 additions & 2 deletions opentelemetry-otlp/examples/basic-otlp-http/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ reqwest-blocking = ["opentelemetry-otlp/reqwest-blocking-client"]
[dependencies]
opentelemetry = { path = "../../../opentelemetry" }
opentelemetry_sdk = { path = "../../../opentelemetry-sdk" }
opentelemetry-otlp = { path = "../.."}
opentelemetry-appender-tracing = { path = "../../../opentelemetry-appender-tracing"}
opentelemetry-otlp = { workspace = true }
opentelemetry-appender-tracing = { workspace = true }

tokio = { workspace = true, features = ["full"] }
tracing = { workspace = true, features = ["std"]}
Expand Down
6 changes: 3 additions & 3 deletions opentelemetry-otlp/examples/basic-otlp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ publish = false
[dependencies]
opentelemetry = { path = "../../../opentelemetry" }
opentelemetry_sdk = { path = "../../../opentelemetry-sdk" }
opentelemetry-otlp = { path = "../../../opentelemetry-otlp", features = ["grpc-tonic"] }
tokio = { version = "1.0", features = ["full"] }
opentelemetry-appender-tracing = { path = "../../../opentelemetry-appender-tracing"}
opentelemetry-otlp = { workspace = true, features = ["grpc-tonic"] }
tokio = { workspace = true, features = ["full"] }
opentelemetry-appender-tracing = { workspace = true }
tracing = { workspace = true, features = ["std"]}
tracing-subscriber = { workspace = true, features = ["env-filter","registry", "std", "fmt"] }

Expand Down
19 changes: 11 additions & 8 deletions opentelemetry-otlp/src/exporter/http/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -449,13 +449,13 @@ impl<B: HasHttpConfig> WithHttpConfig for B {

fn with_headers(mut self, headers: HashMap<String, String>) -> Self {
// headers will be wrapped, so we must do some logic to unwrap first.
self.http_client_config()
let http_client_headers = self
.http_client_config()
.headers
.iter_mut()
.zip(headers)
.for_each(|(http_client_headers, (key, value))| {
http_client_headers.insert(key, super::url_decode(&value).unwrap_or(value));
});
.get_or_insert(HashMap::new());
headers.into_iter().for_each(|(key, value)| {
http_client_headers.insert(key, super::url_decode(&value).unwrap_or(value));
});
self
}
}
Expand Down Expand Up @@ -671,11 +671,14 @@ mod tests {
}

#[test]
fn test_http_exporter_builder_with_header() {
fn test_http_exporter_builder_with_headers() {
use std::collections::HashMap;
// Arrange
let initial_headers = HashMap::from([("k1".to_string(), "v1".to_string())]);
let extra_headers = HashMap::from([("k2".to_string(), "v2".to_string())]);
let extra_headers = HashMap::from([
("k2".to_string(), "v2".to_string()),
("k3".to_string(), "v3".to_string()),
]);
let expected_headers = initial_headers.iter().chain(extra_headers.iter()).fold(
HashMap::new(),
|mut acc, (k, v)| {
Expand Down
12 changes: 6 additions & 6 deletions opentelemetry-otlp/tests/integration_test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ publish = false
opentelemetry = { path = "../../../opentelemetry", features = [] }
opentelemetry_sdk = { path = "../../../opentelemetry-sdk", features = ["rt-tokio", "testing"] }
opentelemetry-proto = { path = "../../../opentelemetry-proto", features = ["gen-tonic-messages", "trace", "logs", "metrics", "with-serde"] }
tokio = { version = "1.0", features = ["full"] }
serde_json = "1"
testcontainers = { version = "0.23.1", features = ["http_wait"]}
tokio = { workspace = true, features = ["full"] }
serde_json = { workspace = true }
testcontainers = { workspace = true, features = ["http_wait"] }
once_cell.workspace = true
anyhow = "1.0.94"
ctor = "0.2.9"
uuid = { version = "1.3", features = ["v4"] }
anyhow = { workspace = true }
ctor = { workspace = true }
uuid = { workspace = true, features = ["v4"] }
tracing-subscriber = { workspace = true, features = ["env-filter","registry", "std", "fmt"] }
tracing = {workspace = true}

Expand Down
8 changes: 4 additions & 4 deletions opentelemetry-proto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,17 @@ tonic = { workspace = true, optional = true, features = ["codegen", "prost"] }
prost = { workspace = true, optional = true }
opentelemetry = { version = "0.28", default-features = false, path = "../opentelemetry" }
opentelemetry_sdk = { version = "0.28", default-features = false, path = "../opentelemetry-sdk" }
schemars = { version = "0.8", optional = true }
schemars = { workspace = true, optional = true }
serde = { workspace = true, optional = true, features = ["serde_derive"] }
hex = { version = "0.4.3", optional = true }
hex = { workspace = true, optional = true }
tracing = {workspace = true, optional = true} # optional for opentelemetry internal logging
base64 = { version = "0.22.1", optional = true }
base64 = { workspace = true, optional = true }

[dev-dependencies]
opentelemetry = { features = ["testing"], path = "../opentelemetry" }
tonic-build = { workspace = true }
prost-build = { workspace = true }
tempfile = "3.3.0"
tempfile = { workspace = true }
serde_json = { workspace = true }

[lints]
Expand Down
17 changes: 8 additions & 9 deletions opentelemetry-sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,21 @@

- **Breaking** The SpanExporter::export() method no longer requires a mutable reference to self.
Before:

```rust
async fn export(&mut self, batch: Vec<SpanData>) -> OTelSdkResult
async fn export(&mut self, batch: Vec<SpanData>) -> OTelSdkResult
```

After:

```rust
async fn export(&self, batch: Vec<SpanData>) -> OTelSdkResult
async fn export(&self, batch: Vec<SpanData>) -> OTelSdkResult
```

Custom exporters will need to internally synchronize any mutable state, if applicable.

- Bug Fix: `BatchLogProcessor` now correctly calls `shutdown` on the exporter
when its `shutdown` is invoked.

- Reduced some info level logs to debug

## 0.28.0

Released 2025-Feb-10
Expand Down Expand Up @@ -93,7 +92,7 @@ field as metadata, a feature introduced in version 0.1.40.
- `Resource::{new,empty,from_detectors,new_with_defaults,from_schema_url,merge,default}`.
To create Resources you should only use `Resource::builder()` or `Resource::builder_empty()`. See
[#2322](https://github.com/open-telemetry/opentelemetry-rust/pull/2322) for a migration guide.

Example Usage:

```rust
Expand Down Expand Up @@ -181,7 +180,7 @@ field as metadata, a feature introduced in version 0.1.40.
- Does not support `hyper`, `reqwest` HTTP Clients
- Does not support multiple concurrent exports (`with_max_concurrent_exports`
is not supported). This existed only for traces.

If this applies to you, you can get the old behavior back by following steps
below:
- Enable one or more of the feature flag from below
Expand Down Expand Up @@ -249,7 +248,7 @@ limit.
- *Breaking*: Rename namespaces for InMemoryExporters. (The module is still
under "testing" feature flag)
before:

```rust
opentelemetry_sdk::testing::logs::{InMemoryLogExporter,
InMemoryLogExporterBuilder};
Expand All @@ -260,7 +259,7 @@ limit.
```

now:

```rust
opentelemetry_sdk::logs::{InMemoryLogExporter, InMemoryLogExporterBuilder};
opentelemetry_sdk::trace::{InMemorySpanExporter,
Expand Down
11 changes: 7 additions & 4 deletions opentelemetry-sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ rust-version = "1.75.0"
opentelemetry = { version = "0.28", path = "../opentelemetry/" }
opentelemetry-http = { version = "0.28", path = "../opentelemetry-http", optional = true }
async-std = { workspace = true, features = ["unstable"], optional = true }
futures-channel = "0.3"
futures-channel = { workspace = true }
futures-executor = { workspace = true }
futures-util = { workspace = true, features = ["std", "sink", "async-await-macro"] }
percent-encoding = { version = "2.0", optional = true }
percent-encoding = { workspace = true, optional = true }
rand = { workspace = true, features = ["std", "std_rng", "small_rng", "os_rng", "thread_rng"], optional = true }
glob = { version = "0.3.1", optional =true}
glob = { workspace = true, optional = true }
serde = { workspace = true, features = ["derive", "rc"], optional = true }
serde_json = { workspace = true, optional = true }
thiserror = { workspace = true }
Expand All @@ -34,7 +34,7 @@ rustdoc-args = ["--cfg", "docsrs"]

[dev-dependencies]
criterion = { workspace = true, features = ["html_reports"] }
rstest = "0.23.0"
rstest = { workspace = true }
temp-env = { workspace = true }

[target.'cfg(not(target_os = "windows"))'.dev-dependencies]
Expand Down Expand Up @@ -108,5 +108,8 @@ name = "log"
harness = false
required-features = ["logs"]

[lib]
bench = false

[lints]
workspace = true
Loading

0 comments on commit 651cc41

Please sign in to comment.