Skip to content

Commit 2213bfa

Browse files
authored
Merge branch 'main' into better-otel-endpoint-construction
2 parents 2caa7b1 + 1be83bb commit 2213bfa

39 files changed

+152
-225
lines changed

.github/dependabot.yml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "cargo"
4+
directory: "/"
5+
schedule:
6+
interval: "monthly"
7+
open-pull-requests-limit: 10
8+
- package-ecosystem: "docker"
9+
directory: "/"
10+
schedule:
11+
interval: "monthly"
12+
- package-ecosystem: "github-actions"
13+
directory: "/"
14+
schedule:
15+
interval: "monthly"

.github/workflows/ci.yml

+13-13
Original file line numberDiff line numberDiff line change
@@ -21,29 +21,29 @@ jobs:
2121
sudo rm -rf /usr/local/lib/android
2222
sudo rm -rf /usr/share/dotnet
2323
df -h
24-
- uses: actions/checkout@v1
24+
- uses: actions/checkout@v4
2525
with:
2626
submodules: true
2727
- uses: actions-rs/toolchain@v1
2828
with:
2929
toolchain: ${{ matrix.rust }}
3030
components: rustfmt
3131
profile: minimal
32-
- uses: arduino/setup-protoc@v1
32+
- uses: arduino/setup-protoc@v3
3333
- name: Test
3434
run: ./scripts/test.sh
3535
lint:
3636
runs-on: ubuntu-latest
3737
steps:
38-
- uses: actions/checkout@v1
38+
- uses: actions/checkout@v4
3939
with:
4040
submodules: true
4141
- uses: actions-rs/toolchain@v1
4242
with:
4343
toolchain: stable
4444
components: rustfmt
4545
profile: minimal
46-
- uses: arduino/setup-protoc@v1
46+
- uses: arduino/setup-protoc@v3
4747
- uses: actions-rs/cargo@v1
4848
with:
4949
command: fmt
@@ -56,7 +56,7 @@ jobs:
5656
example: [opentelemetry, opentelemetry-sdk]
5757
runs-on: ubuntu-latest
5858
steps:
59-
- uses: actions/checkout@v2
59+
- uses: actions/checkout@v4
6060
- uses: actions-rs/toolchain@v1
6161
with:
6262
toolchain: nightly-2024-02-07
@@ -73,23 +73,23 @@ jobs:
7373
example: [opentelemetry-otlp/examples/basic-otlp]
7474
runs-on: ubuntu-latest
7575
steps:
76-
- uses: actions/checkout@v1
76+
- uses: actions/checkout@v4
7777
with:
7878
submodules: true
7979
- uses: actions-rs/toolchain@v1
8080
with:
8181
toolchain: stable
8282
components: rustfmt
8383
profile: minimal
84-
- uses: arduino/setup-protoc@v1
84+
- uses: arduino/setup-protoc@v3
8585
- name: Build
8686
run: |
8787
cd ${{ matrix.example }}
8888
cargo build --verbose
8989
msrv:
9090
runs-on: ubuntu-latest
9191
steps:
92-
- uses: actions/checkout@v1
92+
- uses: actions/checkout@v4
9393
with:
9494
submodules: true
9595
- uses: actions-rs/toolchain@v1
@@ -108,21 +108,21 @@ jobs:
108108
runs-on: ubuntu-latest
109109
continue-on-error: true # Prevent sudden announcement of a new advisory from failing ci
110110
steps:
111-
- uses: actions/checkout@v2
111+
- uses: actions/checkout@v4
112112
- uses: EmbarkStudios/cargo-deny-action@v1
113113
with:
114114
command: check advisories
115115
docs:
116116
continue-on-error: true
117117
runs-on: ubuntu-latest
118118
steps:
119-
- uses: actions/checkout@v2
119+
- uses: actions/checkout@v4
120120
- uses: actions-rs/toolchain@v1
121121
with:
122122
toolchain: nightly
123123
components: rustfmt
124124
override: true
125-
- uses: arduino/setup-protoc@v1
125+
- uses: arduino/setup-protoc@v3
126126
- name: doc
127127
run: cargo doc --no-deps --all-features
128128
env:
@@ -132,15 +132,15 @@ jobs:
132132
continue-on-error: true
133133
runs-on: ubuntu-latest
134134
steps:
135-
- uses: actions/checkout@v3
135+
- uses: actions/checkout@v4
136136
with:
137137
submodules: true
138138
- uses: actions-rs/toolchain@v1
139139
with:
140140
toolchain: stable
141141
components: rustfmt,llvm-tools-preview
142142
override: true
143-
- uses: arduino/setup-protoc@v1
143+
- uses: arduino/setup-protoc@v3
144144
- name: cargo install cargo-llvm-cov
145145
uses: taiki-e/install-action@cargo-llvm-cov
146146
- name: cargo generate-lockfile

.github/workflows/integration_tests.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ on:
77

88
jobs:
99
integration_tests:
10-
rust: stable
1110
runs-on: ubuntu-latest
1211
timeout-minutes: 10
1312
if: ${{ github.event.label.name == 'integration tests' || contains(github.event.pull_request.labels.*.name, 'integration tests') }}
@@ -18,14 +17,14 @@ jobs:
1817
sudo rm -rf /usr/local/lib/android
1918
sudo rm -rf /usr/share/dotnet
2019
df -h
21-
- uses: actions/checkout@v1
20+
- uses: actions/checkout@v4
2221
with:
2322
submodules: true
2423
- uses: actions-rs/toolchain@v1
2524
with:
26-
toolchain: ${{ matrix.rust }}
25+
toolchain: stable
2726
components: rustfmt
2827
profile: minimal
29-
- uses: arduino/setup-protoc@v1
28+
- uses: arduino/setup-protoc@v3
3029
- name: Run integration tests using docker compose
3130
run: ./scripts/integration_tests.sh
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Markdown link check
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
paths:
9+
- '**/*.md'
10+
11+
jobs:
12+
markdown-link-check:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Install markdown-link-check
18+
run: npm install -g markdown-link-check
19+
20+
- name: Run markdown-link-check
21+
run: |
22+
find . -type f \
23+
-name '*.md' \
24+
-not -path '**/CHANGELOG.md' \
25+
| xargs ./scripts/markdown-link-check-with-retry.sh

Cargo.toml

+5-3
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,17 @@ log = "0.4"
4949
once_cell = "1.13"
5050
ordered-float = "4.0"
5151
pin-project-lite = "0.2"
52-
prost = "0.11"
52+
prost = "0.12"
53+
prost-build = "0.12"
54+
prost-types = "0.12"
5355
rand = "0.8"
5456
reqwest = "0.11"
5557
serde = "1.0"
5658
serde_json = "1.0"
57-
surf = "2.0"
5859
temp-env = "0.3.6"
5960
thiserror = "1"
60-
tonic = "0.9"
61+
tonic = "0.11"
62+
tonic-build = "0.11"
6163
tokio = "1"
6264
tokio-stream = "0.1.1"
6365
tracing = "0.1"

examples/tracing-grpc/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ tonic = { workspace = true }
2323
serde_json = { workspace = true }
2424

2525
[build-dependencies]
26-
tonic-build = "0.9.2"
26+
tonic-build = { workspace = true }

opentelemetry-http/CHANGELOG.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
### Changed
66

7+
- **Breaking** Remove built-in support for surf HTTP client [#1537](https://github.com/open-telemetry/opentelemetry-rust/pull/1537)
78
- **Breaking** Surface non-2xx status codes as errors; change `ResponseExt` trait to return `HttpError` instead of `TraceError`[#1484](https://github.com/open-telemetry/opentelemetry-rust/pull/1484)
8-
9-
9+
1010
## v0.10.0
1111

1212
### Changed

opentelemetry-http/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,4 @@ hyper = { workspace = true, features = ["http2", "client", "tcp"], optional = tr
1717
isahc = { workspace = true, optional = true }
1818
opentelemetry = { version = "0.21", path = "../opentelemetry", features = ["trace"] }
1919
reqwest = { workspace = true, features = ["blocking"], optional = true }
20-
surf = { workspace = true, optional = true }
2120
tokio = { workspace = true, features = ["time"], optional = true }

opentelemetry-http/src/lib.rs

-60
Original file line numberDiff line numberDiff line change
@@ -100,66 +100,6 @@ mod reqwest {
100100
}
101101
}
102102

103-
#[cfg(feature = "surf")]
104-
pub mod surf {
105-
use std::str::FromStr;
106-
107-
use http::{header::HeaderName, HeaderMap, HeaderValue};
108-
109-
use super::{async_trait, Bytes, HttpClient, HttpError, Request, Response, ResponseExt};
110-
111-
#[derive(Debug)]
112-
pub struct BasicAuthMiddleware(pub surf::http::auth::BasicAuth);
113-
114-
#[async_trait]
115-
impl surf::middleware::Middleware for BasicAuthMiddleware {
116-
async fn handle(
117-
&self,
118-
mut req: surf::Request,
119-
client: surf::Client,
120-
next: surf::middleware::Next<'_>,
121-
) -> surf::Result<surf::Response> {
122-
req.insert_header(self.0.name(), self.0.value());
123-
next.run(req, client).await
124-
}
125-
}
126-
127-
#[async_trait]
128-
impl HttpClient for surf::Client {
129-
async fn send(&self, request: Request<Vec<u8>>) -> Result<Response<Bytes>, HttpError> {
130-
let (parts, body) = request.into_parts();
131-
let method = parts.method.as_str().parse()?;
132-
let uri = parts.uri.to_string().parse()?;
133-
134-
let mut request_builder = surf::Request::builder(method, uri).body(body);
135-
let mut prev_name = None;
136-
for (new_name, value) in parts.headers.into_iter() {
137-
let name = new_name.or(prev_name).expect("the first time new_name should be set and from then on we always have a prev_name");
138-
request_builder = request_builder.header(name.as_str(), value.to_str()?);
139-
prev_name = Some(name);
140-
}
141-
142-
let mut response = self.send(request_builder).await?;
143-
let mut headers = HeaderMap::new();
144-
for header_name in response.header_names() {
145-
for header_value in &response[header_name.to_string().as_str()] {
146-
headers.append(
147-
HeaderName::from_str(&header_name.to_string())?,
148-
HeaderValue::from_str(header_value.as_str())?,
149-
);
150-
}
151-
}
152-
let mut http_response = Response::builder()
153-
.status(response.status() as u16)
154-
.body(response.body_bytes().await?.into())?;
155-
156-
*http_response.headers_mut() = headers;
157-
158-
Ok(http_response.error_for_status()?)
159-
}
160-
}
161-
}
162-
163103
#[cfg(feature = "isahc")]
164104
mod isahc {
165105
use crate::ResponseExt;

opentelemetry-jaeger-propagator/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ opentelemetry = { version = "0.21", default-features = false, features = [
2626
], path = "../opentelemetry" }
2727

2828
tonic = { workspace = true, optional = true }
29-
prost = { version = "0.11.6", optional = true }
30-
prost-types = { version = "0.11.6", optional = true }
29+
prost = { workspace = true, optional = true }
30+
prost-types = { workspace = true, optional = true }
3131

3232
[dev-dependencies]
3333
opentelemetry_sdk = { features = ["testing"], path = "../opentelemetry-sdk" }

opentelemetry-jaeger/CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
## vNext
44

5+
### Changed
6+
7+
- **Breaking** Remove support for surf HTTP client [#1537](https://github.com/open-telemetry/opentelemetry-rust/pull/1537)
8+
- Update to tonic 0.11 and prost 0.12 (#1536)
9+
510
## v0.21.0
611

712
### Changed

opentelemetry-jaeger/Cargo.toml

+3-6
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,14 @@ opentelemetry-http = { version = "0.10", path = "../opentelemetry-http", optiona
3535
opentelemetry-semantic-conventions = { version = "0.13", path = "../opentelemetry-semantic-conventions" }
3636
pin-project-lite = { workspace = true, optional = true }
3737
reqwest = { workspace = true, optional = true }
38-
surf = { workspace = true, optional = true }
3938
thrift = "0.17.0"
4039
tokio = { workspace = true, features = ["net", "sync"], optional = true }
4140
wasm-bindgen = { version = "0.2", optional = true }
4241
wasm-bindgen-futures = { version = "0.4.18", optional = true }
4342

4443
tonic = { workspace = true, optional = true }
45-
prost = { version = "0.11.6", optional = true }
46-
prost-types = { version = "0.11.6", optional = true }
44+
prost = { workspace = true, optional = true }
45+
prost-types = { workspace = true, optional = true }
4746

4847
# Futures
4948
futures-executor = { workspace = true, features = ["std"], optional = true }
@@ -79,7 +78,6 @@ full = [
7978
"reqwest_collector_client",
8079
"reqwest_blocking_collector_client",
8180
"reqwest_rustls_collector_client",
82-
"surf_collector_client",
8381
"wasm_collector_client",
8482
"rt-tokio",
8583
"rt-tokio-current-thread",
@@ -94,7 +92,6 @@ isahc_collector_client = ["isahc", "opentelemetry-http/isahc"]
9492
reqwest_blocking_collector_client = ["reqwest/blocking", "collector_client", "headers", "opentelemetry-http/reqwest"]
9593
reqwest_collector_client = ["reqwest", "collector_client", "headers", "opentelemetry-http/reqwest"]
9694
reqwest_rustls_collector_client = ["reqwest_collector_client", "reqwest/rustls-tls-native-roots"]
97-
surf_collector_client = ["surf", "collector_client", "opentelemetry-http/surf"]
9895
wasm_collector_client = [
9996
"base64",
10097
"http",
@@ -107,4 +104,4 @@ wasm_collector_client = [
107104
rt-tokio = ["tokio", "opentelemetry_sdk/rt-tokio"]
108105
rt-tokio-current-thread = ["tokio", "opentelemetry_sdk/rt-tokio-current-thread"]
109106
rt-async-std = ["async-std", "opentelemetry_sdk/rt-async-std"]
110-
integration_test = ["tonic", "prost", "prost-types", "rt-tokio", "collector_client", "hyper_collector_client", "hyper_tls_collector_client", "reqwest_collector_client", "surf_collector_client", "isahc_collector_client"]
107+
integration_test = ["tonic", "prost", "prost-types", "rt-tokio", "collector_client", "hyper_collector_client", "hyper_tls_collector_client", "reqwest_collector_client", "isahc_collector_client"]

opentelemetry-jaeger/README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,11 @@ opentelemetry-jaeger = { version = "..", features = ["isahc_collector_client"] }
108108

109109
Then you can use the [`with_collector_endpoint`] method to specify the endpoint:
110110

111-
[`with_collector_endpoint`]: https://docs.rs/opentelemetry-jaeger/latest/opentelemetry_jaeger/struct.PipelineBuilder.html#method.with_collector_endpoint
111+
[`with_collector_endpoint`]: https://docs.rs/opentelemetry-jaeger/latest/opentelemetry_jaeger/config/collector/struct.CollectorPipeline.html#method.with_endpoint
112112

113113
```rust
114114
// Note that this requires one of the following features enabled so that there is a default http client implementation
115115
// * hyper_collector_client
116-
// * surf_collector_client
117116
// * reqwest_collector_client
118117
// * reqwest_blocking_collector_client
119118
// * reqwest_rustls_collector_client
@@ -144,10 +143,11 @@ fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync + 'static>> {
144143

145144
## Kitchen Sink Full Configuration
146145

147-
[Example]((https://docs.rs/opentelemetry-jaeger/latest/opentelemetry_jaeger/#kitchen-sink-full-configuration)) showing how to override all configuration options. See the
148-
[`PipelineBuilder`] docs for details of each option.
146+
[`Example`] showing how to override all configuration options. See the
147+
[`AgentPipeline`] docs for details of each option.
149148

150-
[`PipelineBuilder`]: https://docs.rs/opentelemetry-jaeger/latest/opentelemetry_jaeger/struct.PipelineBuilder.html
149+
[`Example`]: https://docs.rs/opentelemetry-jaeger/latest/opentelemetry_jaeger/#kitchen-sink-full-configuration
150+
[`AgentPipeline`]: https://docs.rs/opentelemetry-jaeger/latest/opentelemetry_jaeger/config/agent/struct.AgentPipeline.html
151151

152152
## Supported Rust Versions
153153

0 commit comments

Comments
 (0)