Skip to content

Commit 8408f5e

Browse files
authored
Merge branch 'main' into cijothomas/release-may-2024
2 parents e97fc9e + 48112e0 commit 8408f5e

File tree

5 files changed

+34
-7
lines changed

5 files changed

+34
-7
lines changed

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

+15-3
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,24 @@ docker-compose down
3232
If you don't want to use `docker-compose`, you can manually run the `otel/opentelemetry-collector` container
3333
and inspect the logs to see traces being transferred.
3434

35+
On Unix based systems use:
36+
3537
```shell
3638
# From the current directory, run `opentelemetry-collector`
37-
$ docker run --rm -it -p 4318:4318 -v $(pwd):/cfg otel/opentelemetry-collector:latest --config=/cfg/otel-collector-config.yaml
39+
docker run --rm -it -p 4318:4318 -v $(pwd):/cfg otel/opentelemetry-collector:latest --config=/cfg/otel-collector-config.yaml
40+
```
41+
42+
On Windows use:
3843

39-
# Run the app which exports logs, metrics and traces via OTLP to the collector.
40-
$ cargo run
44+
```shell
45+
# From the current directory, run `opentelemetry-collector`
46+
docker run --rm -it -p 4318:4318 -v "%cd%":/cfg otel/opentelemetry-collector:latest --config=/cfg/otel-collector-config.yaml
47+
```
48+
49+
Run the app which exports logs, metrics and traces via OTLP to the collector
50+
51+
```shell
52+
cargo run
4153
```
4254

4355
## View results

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

+15-3
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,24 @@ docker-compose down
3232
If you don't want to use `docker-compose`, you can manually run the `otel/opentelemetry-collector` container
3333
and inspect the logs to see traces being transferred.
3434

35+
On Unix based systems use:
36+
3537
```shell
3638
# From the current directory, run `opentelemetry-collector`
37-
$ docker run --rm -it -p 4317:4317 -v $(pwd):/cfg otel/opentelemetry-collector:latest --config=/cfg/otel-collector-config.yaml
39+
docker run --rm -it -p 4317:4317 -v $(pwd):/cfg otel/opentelemetry-collector:latest --config=/cfg/otel-collector-config.yaml
40+
```
41+
42+
On Windows use:
3843

39-
# Run the app which exports logs, metrics and traces via OTLP to the collector.
40-
$ cargo run
44+
```shell
45+
# From the current directory, run `opentelemetry-collector`
46+
docker run --rm -it -p 4317:4317 -v "%cd%":/cfg otel/opentelemetry-collector:latest --config=/cfg/otel-collector-config.yaml
47+
```
48+
49+
Run the app which exports logs, metrics and traces via OTLP to the collector
50+
51+
```shell
52+
cargo run
4153
```
4254

4355
## View results

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

-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync + 'static>> {
114114
for _ in 0..10 {
115115
counter.add(1, &[KeyValue::new("test_key", "test_value")]);
116116
}
117-
counter.add(1, &[KeyValue::new("test_key", "test_value")]);
118117

119118
tracer.in_span("Main operation", |cx| {
120119
let span = cx.span();

opentelemetry-sdk/CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
[1612](https://github.com/open-telemetry/opentelemetry-rust/pull/1612/files)
1010
- [#1422](https://github.com/open-telemetry/opentelemetry-rust/pull/1422)
1111
Fix metrics aggregation bug when using Views to drop attributes.
12+
- [#1766](https://github.com/open-telemetry/opentelemetry-rust/pull/1766)
13+
Fix Metrics PeriodicReader to trigger first collect/export at the first interval
14+
instead of doing it right away.
1215
- [#1623](https://github.com/open-telemetry/opentelemetry-rust/pull/1623) Add Drop implementation for SdkMeterProvider,
1316
which shuts down metricreaders, thereby allowing metrics still in memory to be flushed out.
1417
- **Breaking** [#1624](https://github.com/open-telemetry/opentelemetry-rust/pull/1624) Remove `OsResourceDetector` and

opentelemetry-sdk/src/metrics/periodic_reader.rs

+1
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ where
132132
let ticker = self
133133
.runtime
134134
.interval(self.interval)
135+
.skip(1) // The ticker is fired immediately, so we should skip the first one to align with the interval.
135136
.map(|_| Message::Export);
136137

137138
let messages = Box::pin(stream::select(message_receiver, ticker));

0 commit comments

Comments
 (0)