Skip to content

Commit 4c50b32

Browse files
authored
Merge branch 'main' into experimental-runtime
2 parents 6c49eea + b53c19e commit 4c50b32

File tree

12 files changed

+40
-128
lines changed

12 files changed

+40
-128
lines changed

.cspell.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,12 @@
6060
"reqwest",
6161
"runtimes",
6262
"rustc",
63+
"serde",
6364
"shoppingcart",
6465
"struct",
6566
"Tescher",
6667
"testresults",
68+
"thiserror",
6769
"tracerprovider",
6870
"updown",
6971
"Zhongyang",

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ license = "Apache-2.0"
66
publish = false
77

88
[features]
9+
default = ["reqwest-blocking"]
910
reqwest-blocking = ["opentelemetry-otlp/reqwest-blocking-client"]
10-
hyper = ["opentelemetry-otlp/hyper-client"]
1111

1212
[dependencies]
1313
once_cell = { workspace = true }
1414
opentelemetry = { path = "../../../opentelemetry" }
15-
opentelemetry_sdk = { path = "../../../opentelemetry-sdk", features = ["rt-tokio", "experimental_metrics_periodicreader_with_async_runtime"]}
16-
opentelemetry-otlp = { path = "../..", features = ["http-proto", "http-json", "logs", "internal-logs"]}
15+
opentelemetry_sdk = { path = "../../../opentelemetry-sdk" }
16+
opentelemetry-otlp = { path = "../..", features = ["http-proto", "http-json", "logs", "internal-logs"], default-features = false}
1717
opentelemetry-appender-tracing = { path = "../../../opentelemetry-appender-tracing", default-features = false}
1818

1919
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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ publish = false
88
[dependencies]
99
once_cell = { workspace = true }
1010
opentelemetry = { path = "../../../opentelemetry" }
11-
opentelemetry_sdk = { path = "../../../opentelemetry-sdk", features = ["rt-tokio"] }
11+
opentelemetry_sdk = { path = "../../../opentelemetry-sdk" }
1212
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}

opentelemetry-otlp/examples/basic-otlp/Dockerfile

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

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

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -49,42 +49,21 @@ fn main() -> Result<(), Box<dyn Error + Send + Sync + 'static>> {
4949

5050
## Usage
5151

52-
### `docker-compose`
53-
54-
By default runs against the `otel/opentelemetry-collector:latest` image, and uses the `tonic`'s
55-
`grpc` example as the transport.
56-
57-
```shell
58-
docker-compose up
59-
```
60-
61-
In another terminal run the application `cargo run`
62-
63-
The docker-compose terminal will display logs, traces, metrics.
64-
65-
Press Ctrl+C to stop the collector, and then tear it down:
66-
67-
```shell
68-
docker-compose down
69-
```
70-
71-
### Manual
72-
73-
If you don't want to use `docker-compose`, you can manually run the `otel/opentelemetry-collector` container
74-
and inspect the logs to see traces being transferred.
52+
Run the `otel/opentelemetry-collector` container using docker
53+
and inspect the logs to see the exported telemetry.
7554

7655
On Unix based systems use:
7756

7857
```shell
7958
# From the current directory, run `opentelemetry-collector`
80-
docker run --rm -it -p 4317:4317 -v $(pwd):/cfg otel/opentelemetry-collector:latest --config=/cfg/otel-collector-config.yaml
59+
docker run --rm -it -p 4317:4317 -p 4318:4318 -v $(pwd):/cfg otel/opentelemetry-collector:latest --config=/cfg/otel-collector-config.yaml
8160
```
8261

8362
On Windows use:
8463

8564
```shell
8665
# From the current directory, run `opentelemetry-collector`
87-
docker run --rm -it -p 4317:4317 -v "%cd%":/cfg otel/opentelemetry-collector:latest --config=/cfg/otel-collector-config.yaml
66+
docker run --rm -it -p 4317:4317 -p 4318:4318 -v "%cd%":/cfg otel/opentelemetry-collector:latest --config=/cfg/otel-collector-config.yaml
8867
```
8968

9069
Run the app which exports logs, metrics and traces via OTLP to the collector

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

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

0 commit comments

Comments
 (0)