@@ -84,7 +84,7 @@ impl ResourceDetector for SdkProvidedResourceDetector {
84
84
. or_else ( || {
85
85
EnvResourceDetector :: new ( )
86
86
. detect ( )
87
- . get ( Key :: new ( super :: SERVICE_NAME ) )
87
+ . get ( & Key :: new ( super :: SERVICE_NAME ) )
88
88
} )
89
89
. unwrap_or_else ( || "unknown_service" . into ( ) ) ,
90
90
) ] )
@@ -138,14 +138,14 @@ mod tests {
138
138
// Ensure no env var set
139
139
let no_env = SdkProvidedResourceDetector . detect ( ) ;
140
140
assert_eq ! (
141
- no_env. get( Key :: from_static_str( crate :: resource:: SERVICE_NAME ) ) ,
141
+ no_env. get( & Key :: from_static_str( crate :: resource:: SERVICE_NAME ) ) ,
142
142
Some ( Value :: from( "unknown_service" ) ) ,
143
143
) ;
144
144
145
145
temp_env:: with_var ( OTEL_SERVICE_NAME , Some ( "test service" ) , || {
146
146
let with_service = SdkProvidedResourceDetector . detect ( ) ;
147
147
assert_eq ! (
148
- with_service. get( Key :: from_static_str( crate :: resource:: SERVICE_NAME ) ) ,
148
+ with_service. get( & Key :: from_static_str( crate :: resource:: SERVICE_NAME ) ) ,
149
149
Some ( Value :: from( "test service" ) ) ,
150
150
)
151
151
} ) ;
@@ -156,7 +156,7 @@ mod tests {
156
156
|| {
157
157
let with_service = SdkProvidedResourceDetector . detect ( ) ;
158
158
assert_eq ! (
159
- with_service. get( Key :: from_static_str( crate :: resource:: SERVICE_NAME ) ) ,
159
+ with_service. get( & Key :: from_static_str( crate :: resource:: SERVICE_NAME ) ) ,
160
160
Some ( Value :: from( "test service1" ) ) ,
161
161
)
162
162
} ,
@@ -171,7 +171,7 @@ mod tests {
171
171
|| {
172
172
let with_service = SdkProvidedResourceDetector . detect ( ) ;
173
173
assert_eq ! (
174
- with_service. get( Key :: from_static_str( crate :: resource:: SERVICE_NAME ) ) ,
174
+ with_service. get( & Key :: from_static_str( crate :: resource:: SERVICE_NAME ) ) ,
175
175
Some ( Value :: from( "test service" ) )
176
176
) ;
177
177
} ,
0 commit comments