Skip to content

Commit 6c068cb

Browse files
committed
Merge branch 'main' into cijothomas/metric-test-fix2
2 parents aa0213b + 48112e0 commit 6c068cb

File tree

6 files changed

+44
-7
lines changed

6 files changed

+44
-7
lines changed

.github/workflows/ci.yml

+10
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ jobs:
4040
- name: "Set rustup profile"
4141
run: rustup set profile minimal
4242
- uses: arduino/setup-protoc@v3
43+
with:
44+
repo-token: ${{ secrets.GITHUB_TOKEN }}
4345
- name: Test
4446
run: bash ./scripts/test.sh
4547
lint:
@@ -52,6 +54,8 @@ jobs:
5254
with:
5355
components: rustfmt
5456
- uses: arduino/setup-protoc@v3
57+
with:
58+
repo-token: ${{ secrets.GITHUB_TOKEN }}
5559
- uses: actions-rs/cargo@v1
5660
with:
5761
command: fmt
@@ -88,6 +92,8 @@ jobs:
8892
with:
8993
components: rustfmt
9094
- uses: arduino/setup-protoc@v3
95+
with:
96+
repo-token: ${{ secrets.GITHUB_TOKEN }}
9197
- name: Build
9298
run: |
9399
cd ${{ matrix.example }}
@@ -126,6 +132,8 @@ jobs:
126132
with:
127133
components: rustfmt
128134
- uses: arduino/setup-protoc@v3
135+
with:
136+
repo-token: ${{ secrets.GITHUB_TOKEN }}
129137
- name: doc
130138
run: cargo doc --no-deps --all-features
131139
env:
@@ -144,6 +152,8 @@ jobs:
144152
toolchain: stable
145153
components: rustfmt,llvm-tools-preview
146154
- uses: arduino/setup-protoc@v3
155+
with:
156+
repo-token: ${{ secrets.GITHUB_TOKEN }}
147157
- name: cargo install cargo-llvm-cov
148158
uses: taiki-e/install-action@cargo-llvm-cov
149159
- name: cargo generate-lockfile

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
@@ -7,6 +7,9 @@
77
[1612](https://github.com/open-telemetry/opentelemetry-rust/pull/1612/files)
88
- [#1422](https://github.com/open-telemetry/opentelemetry-rust/pull/1422)
99
Fix metrics aggregation bug when using Views to drop attributes.
10+
- [#1766](https://github.com/open-telemetry/opentelemetry-rust/pull/1766)
11+
Fix Metrics PeriodicReader to trigger first collect/export at the first interval
12+
instead of doing it right away.
1013
- [#1623](https://github.com/open-telemetry/opentelemetry-rust/pull/1623) Add Drop implementation for SdkMeterProvider,
1114
which shuts down metricreaders, thereby allowing metrics still in memory to be flushed out.
1215
- **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)