Skip to content

Commit 4a6e36f

Browse files
authored
Merge branch 'main' into log-async-trait-impl
2 parents 8db475c + b8380eb commit 4a6e36f

File tree

8 files changed

+14
-14
lines changed

8 files changed

+14
-14
lines changed

opentelemetry-otlp/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@
162162
//! .with_max_events_per_span(64)
163163
//! .with_max_attributes_per_span(16)
164164
//! .with_max_events_per_span(16)
165-
//! .with_resource(Resource::builder_empty().with_attributes(vec![KeyValue::new("service.name", "example")]).build()),
165+
//! .with_resource(Resource::builder_empty().with_attributes([KeyValue::new("service.name", "example")]).build()),
166166
//! ).build();
167167
//! global::set_tracer_provider(tracer_provider);
168168
//! let tracer = global::tracer("tracer-name");
@@ -186,7 +186,7 @@
186186
//!
187187
//! let provider = opentelemetry_sdk::metrics::SdkMeterProvider::builder()
188188
//! .with_reader(reader)
189-
//! .with_resource(Resource::builder_empty().with_attributes(vec![KeyValue::new("service.name", "example")]).build())
189+
//! .with_resource(Resource::builder_empty().with_attributes([KeyValue::new("service.name", "example")]).build())
190190
//! .build();
191191
//! # }
192192
//!

opentelemetry-sdk/src/logs/log_emitter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ mod tests {
448448
let user_provided_resource_config_provider = super::LoggerProvider::builder()
449449
.with_resource(
450450
Resource::builder()
451-
.with_attributes(vec![
451+
.with_attributes([
452452
KeyValue::new("my-custom-key", "my-custom-value"),
453453
KeyValue::new("my-custom-key2", "my-custom-value2"),
454454
])

opentelemetry-sdk/src/logs/log_processor.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,7 @@ mod tests {
755755
.with_log_processor(processor)
756756
.with_resource(
757757
Resource::builder_empty()
758-
.with_attributes(vec![
758+
.with_attributes([
759759
KeyValue::new("k1", "v1"),
760760
KeyValue::new("k2", "v3"),
761761
KeyValue::new("k3", "v3"),
@@ -779,7 +779,7 @@ mod tests {
779779
.with_log_processor(processor)
780780
.with_resource(
781781
Resource::builder_empty()
782-
.with_attributes(vec![
782+
.with_attributes([
783783
KeyValue::new("k1", "v1"),
784784
KeyValue::new("k2", "v3"),
785785
KeyValue::new("k3", "v3"),

opentelemetry-sdk/src/logs/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ mod tests {
2828
fn logging_sdk_test() {
2929
// Arrange
3030
let resource = Resource::builder_empty()
31-
.with_attributes(vec![
31+
.with_attributes([
3232
KeyValue::new("k1", "v1"),
3333
KeyValue::new("k2", "v2"),
3434
KeyValue::new("k3", "v3"),

opentelemetry-sdk/src/metrics/meter_provider.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ mod tests {
394394
.with_reader(reader4)
395395
.with_resource(
396396
Resource::builder()
397-
.with_attributes(vec![
397+
.with_attributes([
398398
KeyValue::new("my-custom-key", "my-custom-value"),
399399
KeyValue::new("my-custom-key2", "my-custom-value2"),
400400
])

opentelemetry-sdk/src/resource/env.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ pub struct SdkProvidedResourceDetector;
7575
impl ResourceDetector for SdkProvidedResourceDetector {
7676
fn detect(&self) -> Resource {
7777
Resource::builder_empty()
78-
.with_attributes(vec![KeyValue::new(
78+
.with_attributes([KeyValue::new(
7979
super::SERVICE_NAME,
8080
env::var(OTEL_SERVICE_NAME)
8181
.ok()
@@ -116,7 +116,7 @@ mod tests {
116116
assert_eq!(
117117
resource,
118118
Resource::builder_empty()
119-
.with_attributes(vec![
119+
.with_attributes([
120120
KeyValue::new("key", "value"),
121121
KeyValue::new("k", "v"),
122122
KeyValue::new("a", "x"),

opentelemetry-sdk/src/resource/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ mod tests {
352352
#[test]
353353
fn merge_resource_key_value_pairs() {
354354
let resource_a = Resource::builder_empty()
355-
.with_attributes(vec![
355+
.with_attributes([
356356
KeyValue::new("a", ""),
357357
KeyValue::new("b", "b-value"),
358358
KeyValue::new("d", "d-value"),
@@ -452,7 +452,7 @@ mod tests {
452452
assert_eq!(
453453
resource,
454454
Resource::builder_empty()
455-
.with_attributes(vec![
455+
.with_attributes([
456456
KeyValue::new("key", "value"),
457457
KeyValue::new("k", "v"),
458458
KeyValue::new("a", "x"),
@@ -519,7 +519,7 @@ mod tests {
519519
.with_detector(Box::new(EnvResourceDetector::new()))
520520
.with_service_name("testing_service")
521521
.with_attribute(KeyValue::new("test1", "test_value"))
522-
.with_attributes(vec![
522+
.with_attributes([
523523
KeyValue::new("test1", "test_value1"),
524524
KeyValue::new("test2", "test_value2"),
525525
])
@@ -528,7 +528,7 @@ mod tests {
528528
assert_eq!(
529529
resource,
530530
Resource::builder_empty()
531-
.with_attributes(vec![
531+
.with_attributes([
532532
KeyValue::new("key", "value"),
533533
KeyValue::new("test1", "test_value1"),
534534
KeyValue::new("test2", "test_value2"),

opentelemetry-sdk/src/trace/provider.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ mod tests {
604604
let user_provided_resource_config_provider = super::TracerProvider::builder()
605605
.with_resource(
606606
Resource::builder()
607-
.with_attributes(vec![
607+
.with_attributes([
608608
KeyValue::new("my-custom-key", "my-custom-value"),
609609
KeyValue::new("my-custom-key2", "my-custom-value2"),
610610
])

0 commit comments

Comments
 (0)