@@ -37,17 +37,13 @@ cc_library(
3737 "internal/running_span_store_impl.cc" ,
3838 "internal/sampler.cc" ,
3939 "internal/span.cc" ,
40- "internal/span_context.cc" ,
4140 "internal/span_data.cc" ,
4241 "internal/span_exporter.cc" ,
4342 "internal/span_exporter_impl.cc" ,
44- "internal/span_id.cc" ,
4543 "internal/span_impl.cc" ,
4644 "internal/status.cc" ,
4745 "internal/trace_config.cc" ,
4846 "internal/trace_config_impl.cc" ,
49- "internal/trace_id.cc" ,
50- "internal/trace_options.cc" ,
5147 ],
5248 hdrs = [
5349 "attribute_value_ref.h" ,
@@ -70,17 +66,15 @@ cc_library(
7066 "internal/trace_params_impl.h" ,
7167 "sampler.h" ,
7268 "span.h" ,
73- "span_context.h" ,
74- "span_id.h" ,
7569 "status_code.h" ,
7670 "trace_config.h" ,
77- "trace_id.h" ,
78- "trace_options.h" ,
7971 "trace_params.h" ,
8072 ],
8173 copts = DEFAULT_COPTS ,
8274 visibility = ["//visibility:public" ],
8375 deps = [
76+ ":cloud_trace_context" ,
77+ ":span_context" ,
8478 "//opencensus/common/internal:random_lib" ,
8579 "@com_google_absl//absl/base:core_headers" ,
8680 "@com_google_absl//absl/base:endian" ,
@@ -91,6 +85,23 @@ cc_library(
9185 ],
9286)
9387
88+ cc_library (
89+ name = "cloud_trace_context" ,
90+ srcs = [
91+ "internal/cloud_trace_context.cc" ,
92+ ],
93+ hdrs = [
94+ "propagation/cloud_trace_context.h" ,
95+ ],
96+ copts = DEFAULT_COPTS ,
97+ visibility = ["//visibility:public" ],
98+ deps = [
99+ ":span_context" ,
100+ "@com_google_absl//absl/base:endian" ,
101+ "@com_google_absl//absl/strings" ,
102+ ],
103+ )
104+
94105cc_library (
95106 name = "context_util" ,
96107 srcs = ["internal/context_util.cc" ],
@@ -103,6 +114,27 @@ cc_library(
103114 ],
104115)
105116
117+ cc_library (
118+ name = "span_context" ,
119+ srcs = [
120+ "internal/span_context.cc" ,
121+ "internal/span_id.cc" ,
122+ "internal/trace_id.cc" ,
123+ "internal/trace_options.cc" ,
124+ ],
125+ hdrs = [
126+ "span_context.h" ,
127+ "span_id.h" ,
128+ "trace_id.h" ,
129+ "trace_options.h" ,
130+ ],
131+ copts = DEFAULT_COPTS ,
132+ visibility = ["//visibility:public" ],
133+ deps = [
134+ "@com_google_absl//absl/strings" ,
135+ ],
136+ )
137+
106138cc_library (
107139 name = "with_span" ,
108140 srcs = ["internal/with_span.cc" ],
@@ -150,6 +182,17 @@ cc_test(
150182 ],
151183)
152184
185+ cc_test (
186+ name = "cloud_trace_context_test" ,
187+ srcs = ["internal/cloud_trace_context_test.cc" ],
188+ copts = TEST_COPTS ,
189+ deps = [
190+ ":cloud_trace_context" ,
191+ ":span_context" ,
192+ "@com_google_googletest//:gtest_main" ,
193+ ],
194+ )
195+
153196cc_test (
154197 name = "context_util_test" ,
155198 srcs = ["internal/context_util_test.cc" ],
@@ -168,6 +211,7 @@ cc_test(
168211 srcs = ["internal/link_test.cc" ],
169212 copts = TEST_COPTS ,
170213 deps = [
214+ ":span_context" ,
171215 ":trace" ,
172216 "@com_google_googletest//:gtest_main" ,
173217 ],
@@ -188,6 +232,7 @@ cc_test(
188232 srcs = ["internal/running_span_store_test.cc" ],
189233 copts = TEST_COPTS ,
190234 deps = [
235+ ":span_context" ,
191236 ":trace" ,
192237 "@com_google_absl//absl/base:core_headers" ,
193238 "@com_google_absl//absl/memory" ,
@@ -212,6 +257,7 @@ cc_test(
212257 srcs = ["internal/span_test.cc" ],
213258 copts = TEST_COPTS ,
214259 deps = [
260+ ":span_context" ,
215261 ":trace" ,
216262 "@com_google_absl//absl/strings" ,
217263 "@com_google_googletest//:gtest_main" ,
@@ -223,7 +269,7 @@ cc_test(
223269 srcs = ["internal/span_id_test.cc" ],
224270 copts = TEST_COPTS ,
225271 deps = [
226- ":trace " ,
272+ ":span_context " ,
227273 "@com_google_googletest//:gtest_main" ,
228274 ],
229275)
@@ -233,6 +279,7 @@ cc_test(
233279 srcs = ["internal/span_options_test.cc" ],
234280 copts = TEST_COPTS ,
235281 deps = [
282+ ":span_context" ,
236283 ":trace" ,
237284 "@com_google_absl//absl/strings" ,
238285 "@com_google_absl//absl/synchronization" ,
@@ -245,7 +292,7 @@ cc_test(
245292 srcs = ["internal/span_context_test.cc" ],
246293 copts = TEST_COPTS ,
247294 deps = [
248- ":trace " ,
295+ ":span_context " ,
249296 "@com_google_googletest//:gtest_main" ,
250297 ],
251298)
@@ -289,7 +336,7 @@ cc_test(
289336 srcs = ["internal/trace_options_test.cc" ],
290337 copts = TEST_COPTS ,
291338 deps = [
292- ":trace " ,
339+ ":span_context " ,
293340 "@com_google_googletest//:gtest_main" ,
294341 ],
295342)
@@ -299,6 +346,7 @@ cc_test(
299346 srcs = ["internal/with_span_test.cc" ],
300347 copts = TEST_COPTS ,
301348 deps = [
349+ ":span_context" ,
302350 ":trace" ,
303351 ":with_span" ,
304352 "//opencensus/context" ,
@@ -314,22 +362,33 @@ cc_binary(
314362 testonly = 1 ,
315363 srcs = ["internal/attribute_value_ref_benchmark.cc" ],
316364 copts = TEST_COPTS ,
317- linkopts = ["-pthread" ], # Required for absl/synchronization bits.
318365 linkstatic = 1 ,
319366 deps = [
320367 ":trace" ,
321368 "@com_github_google_benchmark//:benchmark" ,
322369 ],
323370)
324371
372+ cc_binary (
373+ name = "cloud_trace_context_benchmark" ,
374+ testonly = 1 ,
375+ srcs = ["internal/cloud_trace_context_benchmark.cc" ],
376+ copts = TEST_COPTS ,
377+ linkstatic = 1 ,
378+ deps = [
379+ ":cloud_trace_context" ,
380+ "@com_github_google_benchmark//:benchmark" ,
381+ ],
382+ )
383+
325384cc_binary (
326385 name = "span_benchmark" ,
327386 testonly = 1 ,
328387 srcs = ["internal/span_benchmark.cc" ],
329388 copts = TEST_COPTS ,
330- linkopts = ["-pthread" ], # Required for absl/synchronization bits.
331389 linkstatic = 1 ,
332390 deps = [
391+ ":span_context" ,
333392 ":trace" ,
334393 "@com_github_google_benchmark//:benchmark" ,
335394 ],
@@ -340,10 +399,9 @@ cc_binary(
340399 testonly = 1 ,
341400 srcs = ["internal/span_id_benchmark.cc" ],
342401 copts = TEST_COPTS ,
343- linkopts = ["-pthread" ], # Required for absl/synchronization bits.
344402 linkstatic = 1 ,
345403 deps = [
346- ":trace " ,
404+ ":span_context " ,
347405 "@com_github_google_benchmark//:benchmark" ,
348406 ],
349407)
@@ -353,7 +411,6 @@ cc_binary(
353411 testonly = 1 ,
354412 srcs = ["internal/with_span_benchmark.cc" ],
355413 copts = TEST_COPTS ,
356- linkopts = ["-pthread" ], # Required for absl/synchronization bits.
357414 linkstatic = 1 ,
358415 deps = [
359416 ":trace" ,
0 commit comments