blob: 4eb6582c1a57161e86cda9a341acf640c265eb9f [file] [edit]
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
load("@rules_cc//cc:cc_library.bzl", "cc_library")
load("@rules_cc//cc:cc_test.bzl", "cc_test")
package(default_visibility = ["//visibility:public"])
cc_library(
name = "span",
srcs = [
"scoped_span.cc",
"thread_context.cc",
],
hdrs = [
"scoped_span.h",
"span.h",
"thread_context.h",
],
deps = [
"@abseil-cpp//absl/base:nullability",
"@abseil-cpp//absl/status",
"@abseil-cpp//absl/strings:string_view",
],
)
cc_test(
name = "span_test",
srcs = ["span_test.cc"],
deps = [
":span",
":tracer",
"@abseil-cpp//absl/status",
"@abseil-cpp//absl/strings:string_view",
"@googletest//:gtest_main",
],
)
cc_test(
name = "thread_context_test",
srcs = ["thread_context_test.cc"],
deps = [
":span",
":tracer",
"@googletest//:gtest_main",
],
)
cc_library(
name = "tracer",
srcs = [
"noop_tracing.cc",
"tracer_factory.cc",
],
hdrs = [
"noop_tracing.h",
"tracer.h",
"tracer_factory.h",
],
deps = [
":span",
"//async:async_context",
"@abseil-cpp//absl/base:core_headers",
"@abseil-cpp//absl/base:nullability",
"@abseil-cpp//absl/status",
"@abseil-cpp//absl/strings:string_view",
"@abseil-cpp//absl/synchronization",
],
)
cc_test(
name = "tracer_test",
srcs = ["tracer_test.cc"],
deps = [
":scoped_tracer_factory",
":span",
":tracer",
"//async:async_context",
"@abseil-cpp//absl/base:nullability",
"@abseil-cpp//absl/status",
"@abseil-cpp//absl/strings:string_view",
"@googletest//:gtest_main",
],
)
cc_test(
name = "scoped_span_test",
srcs = ["scoped_span_test.cc"],
deps = [
":span",
"@abseil-cpp//absl/status",
"@abseil-cpp//absl/strings:string_view",
"@googletest//:gtest_main",
],
)
cc_library(
name = "test_tracing",
testonly = 1,
srcs = ["test_tracing.cc"],
hdrs = ["test_tracing.h"],
deps = [
":span",
":tracer",
"@abseil-cpp//absl/base:core_headers",
"@abseil-cpp//absl/container:flat_hash_map",
"@abseil-cpp//absl/status",
"@abseil-cpp//absl/strings:str_format",
"@abseil-cpp//absl/strings:string_view",
"@abseil-cpp//absl/synchronization",
"@abseil-cpp//absl/time",
],
)
cc_library(
name = "scoped_tracer_factory",
srcs = ["scoped_tracer_factory.cc"],
hdrs = ["scoped_tracer_factory.h"],
deps = [
":tracer",
"@abseil-cpp//absl/base:nullability",
],
)
cc_test(
name = "test_tracing_test",
srcs = ["test_tracing_test.cc"],
deps = [
":span",
":test_tracing",
":tracer",
"@abseil-cpp//absl/status",
"@abseil-cpp//absl/strings:string_view",
"@abseil-cpp//absl/time",
"@googletest//:gtest_main",
],
)