Skip to content

Commit 5434fbf

Browse files
authored
Merge branch 'main' into cijothomas/logprocessordocfix
2 parents 7c85021 + 2c364dd commit 5434fbf

File tree

5 files changed

+90
-10
lines changed

5 files changed

+90
-10
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
with:
6666
toolchain: stable
6767
components: rustfmt, clippy
68-
- uses: taiki-e/install-action@d6d752794628f1e1fffa3c4d3c8874e06f043d50 # v2.62.15
68+
- uses: taiki-e/install-action@47be02f2de8a32619316956f6117e150bdc6763f # v2.62.44
6969
with:
7070
tool: cargo-hack
7171
- uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0
@@ -93,7 +93,7 @@ jobs:
9393
# https://github.com/awslabs/cargo-check-external-types/releases
9494
toolchain: nightly-2025-05-04
9595
components: rustfmt
96-
- uses: taiki-e/install-action@d6d752794628f1e1fffa3c4d3c8874e06f043d50 # v2.62.15
96+
- uses: taiki-e/install-action@47be02f2de8a32619316956f6117e150bdc6763f # v2.62.44
9797
with:
9898
9999
- name: external-type-check
@@ -117,7 +117,7 @@ jobs:
117117
- uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9
118118
with:
119119
toolchain: stable
120-
- uses: taiki-e/install-action@d6d752794628f1e1fffa3c4d3c8874e06f043d50 # v2.62.15
120+
- uses: taiki-e/install-action@47be02f2de8a32619316956f6117e150bdc6763f # v2.62.44
121121
with:
122122
tool: cargo-msrv
123123
- uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0
@@ -199,7 +199,7 @@ jobs:
199199
with:
200200
repo-token: ${{ secrets.GITHUB_TOKEN }}
201201
- name: Install cargo-llvm-cov
202-
uses: taiki-e/install-action@d6d752794628f1e1fffa3c4d3c8874e06f043d50 # v2.62.15
202+
uses: taiki-e/install-action@47be02f2de8a32619316956f6117e150bdc6763f # v2.62.44
203203
with:
204204
tool: cargo-llvm-cov
205205
- name: cargo generate-lockfile
@@ -247,7 +247,7 @@ jobs:
247247
- uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9
248248
with:
249249
toolchain: stable
250-
- uses: taiki-e/install-action@d6d752794628f1e1fffa3c4d3c8874e06f043d50 # v2.62.15
250+
- uses: taiki-e/install-action@47be02f2de8a32619316956f6117e150bdc6763f # v2.62.44
251251
with:
252252
tool: cargo-machete
253253
- name: cargo machete

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ jobs:
3434
submodules: true
3535

3636
- name: Initialize CodeQL
37-
uses: github/codeql-action/init@3599b3baa15b485a2e49ef411a7a4bb2452e7f93 # v3.30.5
37+
uses: github/codeql-action/init@0499de31b99561a6d14a36a5f662c2a54f91beee # v4.31.2
3838
with:
3939
languages: rust
4040

4141
- name: Autobuild
42-
uses: github/codeql-action/autobuild@3599b3baa15b485a2e49ef411a7a4bb2452e7f93 # v3.30.5
42+
uses: github/codeql-action/autobuild@0499de31b99561a6d14a36a5f662c2a54f91beee # v4.31.2
4343

4444
- name: Perform CodeQL Analysis
45-
uses: github/codeql-action/analyze@3599b3baa15b485a2e49ef411a7a4bb2452e7f93 # v3.30.5
45+
uses: github/codeql-action/analyze@0499de31b99561a6d14a36a5f662c2a54f91beee # v4.31.2

.github/workflows/ossf-scorecard.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
# uploads of run results in SARIF format to the repository Actions tab.
4040
# https://docs.github.com/en/actions/advanced-guides/storing-workflow-data-as-artifacts
4141
- name: "Upload artifact"
42-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
42+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
4343
with:
4444
name: SARIF file
4545
path: results.sarif
@@ -48,6 +48,6 @@ jobs:
4848
# Upload the results to GitHub's code scanning dashboard (optional).
4949
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
5050
- name: "Upload to code-scanning"
51-
uses: github/codeql-action/upload-sarif@3599b3baa15b485a2e49ef411a7a4bb2452e7f93 # v3.30.5
51+
uses: github/codeql-action/upload-sarif@0499de31b99561a6d14a36a5f662c2a54f91beee # v4.31.2
5252
with:
5353
sarif_file: results.sarif

opentelemetry/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Released 2025-Sep-25
1010

1111
- *Breaking* Change return type of `opentelemetry::global::set_tracer_provider` to Unit to align with metrics counterpart
1212
- Add `get_all` method to `opentelemetry::propagation::Extractor` to return all values of the given propagation key and provide a default implementation.
13+
- Add an `IntoIterator` implementation for `opentelemetry::trace::TraceState` to allow iterating through its key-value pair collection.
1314

1415
## 0.30.0
1516

opentelemetry/src/trace/span_context.rs

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,50 @@ impl FromStr for TraceState {
211211
}
212212
}
213213

214+
/// Iterator over TraceState key-value pairs as (&str, &str)
215+
#[derive(Debug)]
216+
pub struct TraceStateIter<'a> {
217+
inner: Option<std::collections::vec_deque::Iter<'a, (String, String)>>,
218+
}
219+
220+
impl<'a> Iterator for TraceStateIter<'a> {
221+
type Item = (&'a str, &'a str);
222+
223+
fn next(&mut self) -> Option<Self::Item> {
224+
self.inner
225+
.as_mut()?
226+
.next()
227+
.map(|(key, value)| (key.as_str(), value.as_str()))
228+
}
229+
230+
fn size_hint(&self) -> (usize, Option<usize>) {
231+
match &self.inner {
232+
Some(iter) => iter.size_hint(),
233+
None => (0, Some(0)),
234+
}
235+
}
236+
}
237+
238+
impl ExactSizeIterator for TraceStateIter<'_> {
239+
fn len(&self) -> usize {
240+
match &self.inner {
241+
Some(iter) => iter.len(),
242+
None => 0,
243+
}
244+
}
245+
}
246+
247+
impl<'a> IntoIterator for &'a TraceState {
248+
type Item = (&'a str, &'a str);
249+
type IntoIter = TraceStateIter<'a>;
250+
251+
fn into_iter(self) -> Self::IntoIter {
252+
TraceStateIter {
253+
inner: self.0.as_ref().map(|deque| deque.iter()),
254+
}
255+
}
256+
}
257+
214258
/// A specialized `Result` type for trace state operations.
215259
type TraceStateResult<T> = Result<T, TraceStateError>;
216260

@@ -417,4 +461,39 @@ mod tests {
417461
}"
418462
);
419463
}
464+
465+
#[test]
466+
fn test_tracestate_iter_empty() {
467+
let ts = TraceState::NONE;
468+
let mut iter = ts.into_iter();
469+
assert_eq!(iter.next(), None);
470+
assert_eq!(iter.size_hint(), (0, Some(0)));
471+
assert_eq!(iter.len(), 0);
472+
}
473+
474+
#[test]
475+
fn test_tracestate_iter_single() {
476+
let ts = TraceState::from_key_value(vec![("foo", "bar")]).unwrap();
477+
let mut iter = ts.into_iter();
478+
assert_eq!(iter.next(), Some(("foo", "bar")));
479+
assert_eq!(iter.next(), None);
480+
assert_eq!(iter.size_hint(), (0, Some(0)));
481+
}
482+
483+
#[test]
484+
fn test_tracestate_iter_multiple() {
485+
let ts = TraceState::from_key_value(vec![("foo", "bar"), ("apple", "banana")]).unwrap();
486+
let mut iter = ts.into_iter();
487+
assert_eq!(iter.next(), Some(("foo", "bar")));
488+
assert_eq!(iter.next(), Some(("apple", "banana")));
489+
assert_eq!(iter.next(), None);
490+
}
491+
492+
#[test]
493+
fn test_tracestate_iter_size_hint_and_len() {
494+
let ts = TraceState::from_key_value(vec![("foo", "bar"), ("apple", "banana")]).unwrap();
495+
let iter = ts.into_iter();
496+
assert_eq!(iter.size_hint(), (2, Some(2)));
497+
assert_eq!(iter.len(), 2);
498+
}
420499
}

0 commit comments

Comments
 (0)