@@ -89,11 +89,8 @@ def test_enable_trace_call(setup, setup_optin):
89
89
extra_attributes = {
90
90
"attribute1" : "value1" ,
91
91
}
92
- expected_attributes = {
93
- "rpc.service" : "CloudStorage" ,
94
- "rpc.system" : "http" ,
95
- "user_agent.original" : f"gcloud-python/{ __version__ } " ,
96
- }
92
+ expected_attributes = _opentelemetry_tracing ._default_attributes .copy ()
93
+ expected_attributes .update (_opentelemetry_tracing ._cloud_trace_adoption_attrs )
97
94
expected_attributes .update (extra_attributes )
98
95
99
96
with _opentelemetry_tracing .create_trace_span (
@@ -114,11 +111,8 @@ def test_enable_trace_error(setup, setup_optin):
114
111
extra_attributes = {
115
112
"attribute1" : "value1" ,
116
113
}
117
- expected_attributes = {
118
- "rpc.service" : "CloudStorage" ,
119
- "rpc.system" : "http" ,
120
- "user_agent.original" : f"gcloud-python/{ __version__ } " ,
121
- }
114
+ expected_attributes = _opentelemetry_tracing ._default_attributes .copy ()
115
+ expected_attributes .update (_opentelemetry_tracing ._cloud_trace_adoption_attrs )
122
116
expected_attributes .update (extra_attributes )
123
117
124
118
with pytest .raises (GoogleAPICallError ):
@@ -157,6 +151,7 @@ def test_get_final_attributes(setup, setup_optin):
157
151
"connect_timeout,read_timeout" : (100 , 100 ),
158
152
"retry" : f"multiplier{ retry_obj ._multiplier } /deadline{ retry_obj ._deadline } /max{ retry_obj ._maximum } /initial{ retry_obj ._initial } /predicate{ retry_obj ._predicate } " ,
159
153
}
154
+ expected_attributes .update (_opentelemetry_tracing ._cloud_trace_adoption_attrs )
160
155
161
156
with mock .patch ("google.cloud.storage.client.Client" ) as test_client :
162
157
test_client .project = "test_project"
@@ -185,12 +180,12 @@ def test_set_conditional_retry_attr(setup, setup_optin):
185
180
retry_policy , conditional_predicate , required_kwargs
186
181
)
187
182
188
- expected_attributes = {
189
- "rpc.service" : "CloudStorage" ,
190
- "rpc.system" : "http" ,
191
- "user_agent.original" : f"gcloud-python/{ __version__ } " ,
183
+ retry_attrs = {
192
184
"retry" : f"multiplier{ retry_policy ._multiplier } /deadline{ retry_policy ._deadline } /max{ retry_policy ._maximum } /initial{ retry_policy ._initial } /predicate{ conditional_predicate } " ,
193
185
}
186
+ expected_attributes = _opentelemetry_tracing ._default_attributes .copy ()
187
+ expected_attributes .update (_opentelemetry_tracing ._cloud_trace_adoption_attrs )
188
+ expected_attributes .update (retry_attrs )
194
189
195
190
with _opentelemetry_tracing .create_trace_span (
196
191
test_span_name ,
0 commit comments