xref: /aosp_15_r20/external/grpc-grpc/src/cpp/ext/otel/BUILD (revision cc02d7e222339f7a4f6ba5f422e6413f4bd931f2)
1# gRPC Bazel BUILD file.
2#
3# Copyright 2023 gRPC authors.
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9#     http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16
17load(
18    "//bazel:grpc_build_system.bzl",
19    "grpc_cc_library",
20)
21
22licenses(["reciprocal"])
23
24package(
25    default_visibility = ["//visibility:public"],
26    features = [
27        "layering_check",
28    ],
29)
30
31grpc_cc_library(
32    name = "otel_plugin",
33    srcs = [
34        "otel_client_call_tracer.cc",
35        "otel_plugin.cc",
36        "otel_server_call_tracer.cc",
37    ],
38    hdrs = [
39        "key_value_iterable.h",
40        "otel_client_call_tracer.h",
41        "otel_plugin.h",
42        "otel_server_call_tracer.h",
43        "//:include/grpcpp/ext/otel_plugin.h",
44    ],
45    external_deps = [
46        "absl/base:core_headers",
47        "absl/container:flat_hash_map",
48        "absl/container:flat_hash_set",
49        "absl/functional:any_invocable",
50        "absl/status",
51        "absl/status:statusor",
52        "absl/strings",
53        "absl/strings:str_format",
54        "absl/time",
55        "absl/types:optional",
56        "absl/types:span",
57        "otel/api",
58    ],
59    language = "c++",
60    visibility = ["//:__subpackages__"],
61    deps = [
62        "//:call_tracer",
63        "//:config",
64        "//:gpr",
65        "//:gpr_platform",
66        "//:grpc++",
67        "//:grpc_base",
68        "//:grpc_client_channel",
69        "//:grpc_public_hdrs",
70        "//:legacy_context",
71        "//:tcp_tracer",
72        "//src/core:arena",
73        "//src/core:arena_promise",
74        "//src/core:channel_args",
75        "//src/core:channel_fwd",
76        "//src/core:channel_stack_type",
77        "//src/core:context",
78        "//src/core:error",
79        "//src/core:match",
80        "//src/core:metadata_batch",
81        "//src/core:metrics",
82        "//src/core:slice",
83        "//src/core:slice_buffer",
84    ],
85)
86