Skip to content

Commit 7d15c59

Browse files
authored
Merge branch 'main' into http-client-request-body-bytes
2 parents b5be5cc + 68af3bb commit 7d15c59

File tree

26 files changed

+478
-274
lines changed

26 files changed

+478
-274
lines changed

.cspell.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,13 @@
6060
"reqwest",
6161
"runtimes",
6262
"rustc",
63+
"serde",
6364
"shoppingcart",
6465
"struct",
6566
"Tescher",
67+
"testcontainers",
6668
"testresults",
69+
"thiserror",
6770
"tracerprovider",
6871
"updown",
6972
"Zhongyang",

opentelemetry-otlp/CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
- Feature flag "populate-logs-event-name" is removed as no longer relevant.
77
LogRecord's `event_name()` is now automatically populated on the newly added
88
"event_name" field in LogRecord proto definition.
9-
9+
- Remove "grpc-tonic" feature from default, and instead add "http-proto" and
10+
"reqwest-blocking-client" features as default, to align with the
11+
specification.
12+
[2516](https://github.com/open-telemetry/opentelemetry-rust/pull/2516)
1013

1114
## 0.27.0
1215

opentelemetry-otlp/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ internal-logs = ["tracing", "opentelemetry/internal-logs"]
6262
# add ons
6363
serialize = ["serde", "serde_json"]
6464

65-
default = ["grpc-tonic", "trace", "metrics", "logs", "internal-logs"]
65+
default = ["http-proto", "reqwest-blocking-client", "trace", "metrics", "logs", "internal-logs"]
6666

6767
# grpc using tonic
6868
grpc-tonic = ["tonic", "prost", "http", "tokio", "opentelemetry-proto/gen-tonic"]

opentelemetry-otlp/examples/basic-otlp-http/Cargo.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,12 @@ publish = false
88
[features]
99
default = ["reqwest-blocking"]
1010
reqwest-blocking = ["opentelemetry-otlp/reqwest-blocking-client"]
11-
hyper = ["opentelemetry-otlp/hyper-client"]
1211

1312
[dependencies]
1413
once_cell = { workspace = true }
1514
opentelemetry = { path = "../../../opentelemetry" }
16-
opentelemetry_sdk = { path = "../../../opentelemetry-sdk", features = ["rt-tokio", "experimental_metrics_periodicreader_with_async_runtime"]}
17-
opentelemetry-otlp = { path = "../..", features = ["http-proto", "http-json", "logs", "internal-logs"] , default-features = false}
15+
opentelemetry_sdk = { path = "../../../opentelemetry-sdk" }
16+
opentelemetry-otlp = { path = "../..", features = ["http-proto", "http-json", "logs", "internal-logs"], default-features = false}
1817
opentelemetry-appender-tracing = { path = "../../../opentelemetry-appender-tracing", default-features = false}
1918

2019
tokio = { workspace = true, features = ["full"] }

opentelemetry-otlp/examples/basic-otlp-http/Dockerfile

Lines changed: 0 additions & 6 deletions
This file was deleted.

opentelemetry-otlp/examples/basic-otlp-http/README.md

Lines changed: 6 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -16,46 +16,25 @@ recommended approach when using OTLP exporters. While it can be modified to use
1616
a `SimpleExporter`, this requires making the main function a regular main and
1717
*not* tokio main.
1818

19-
// TODO: Document `hyper` feature flag when using SimpleProcessor.
19+
// TODO: Document how to use hyper client.
2020

2121
## Usage
2222

23-
### `docker-compose`
24-
25-
By default runs against the `otel/opentelemetry-collector:latest` image, and uses `reqwest-client`
26-
as the http client, using http as the transport.
27-
28-
```shell
29-
docker-compose up
30-
```
31-
32-
In another terminal run the application `cargo run`
33-
34-
The docker-compose terminal will display logs, traces, metrics.
35-
36-
Press Ctrl+C to stop the collector, and then tear it down:
37-
38-
```shell
39-
docker-compose down
40-
```
41-
42-
### Manual
43-
44-
If you don't want to use `docker-compose`, you can manually run the `otel/opentelemetry-collector` container
45-
and inspect the logs to see traces being transferred.
23+
Run the `otel/opentelemetry-collector` container using docker
24+
and inspect the logs to see the exported telemetry.
4625

4726
On Unix based systems use:
4827

4928
```shell
5029
# From the current directory, run `opentelemetry-collector`
51-
docker run --rm -it -p 4318:4318 -v $(pwd):/cfg otel/opentelemetry-collector:latest --config=/cfg/otel-collector-config.yaml
30+
docker run --rm -it -p 4317:4317 -p 4318:4318 -v $(pwd):/cfg otel/opentelemetry-collector:latest --config=/cfg/otel-collector-config.yaml
5231
```
5332

5433
On Windows use:
5534

5635
```shell
5736
# From the current directory, run `opentelemetry-collector`
58-
docker run --rm -it -p 4318:4318 -v "%cd%":/cfg otel/opentelemetry-collector:latest --config=/cfg/otel-collector-config.yaml
37+
docker run --rm -it -p 4317:4317 -p 4318:4318 -v "%cd%":/cfg otel/opentelemetry-collector:latest --config=/cfg/otel-collector-config.yaml
5938
```
6039

6140
Run the app which exports logs, metrics and traces via OTLP to the collector
@@ -64,11 +43,7 @@ Run the app which exports logs, metrics and traces via OTLP to the collector
6443
cargo run
6544
```
6645

67-
By default the app will use a `reqwest` client to send. A hyper 0.14 client can be used with the `hyper` feature enabled
68-
69-
```shell
70-
cargo run --no-default-features --features=hyper
71-
```
46+
The app will use a `reqwest-blocking` client to send.
7247

7348
## View results
7449

opentelemetry-otlp/examples/basic-otlp-http/docker-compose.yaml

Lines changed: 0 additions & 15 deletions
This file was deleted.

opentelemetry-otlp/examples/basic-otlp-http/src/main.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,8 @@ fn init_metrics() -> Result<opentelemetry_sdk::metrics::SdkMeterProvider, Metric
6969
.build())
7070
}
7171

72-
// #[tokio::main]
73-
// TODO: Re-enable tokio::main, if needed, after
74-
fn main() -> Result<(), Box<dyn Error + Send + Sync + 'static>> {
72+
#[tokio::main]
73+
async fn main() -> Result<(), Box<dyn Error + Send + Sync + 'static>> {
7574
let logger_provider = init_logs()?;
7675

7776
// Create a new OpenTelemetryTracingBridge using the above LoggerProvider.

opentelemetry-otlp/examples/basic-otlp/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ publish = false
88
[dependencies]
99
once_cell = { workspace = true }
1010
opentelemetry = { path = "../../../opentelemetry" }
11-
opentelemetry_sdk = { path = "../../../opentelemetry-sdk", features = ["rt-tokio"] }
12-
opentelemetry-otlp = { path = "../../../opentelemetry-otlp" }
11+
opentelemetry_sdk = { path = "../../../opentelemetry-sdk" }
12+
opentelemetry-otlp = { path = "../../../opentelemetry-otlp", features = ["grpc-tonic"] }
1313
tokio = { version = "1.0", features = ["full"] }
1414
opentelemetry-appender-tracing = { path = "../../../opentelemetry-appender-tracing", default-features = false}
1515
tracing = { workspace = true, features = ["std"]}

opentelemetry-otlp/examples/basic-otlp/Dockerfile

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)