xref: /aosp_15_r20/external/grpc-grpc/examples/cpp/otel/BUILD (revision cc02d7e222339f7a4f6ba5f422e6413f4bd931f2)
1# Copyright 2023 the gRPC authors.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#     http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15licenses(["notice"])
16
17package(
18    default_visibility = ["//examples/cpp/otel:__subpackages__"],
19)
20
21cc_library(
22    name = "util",
23    srcs = ["util.cc"],
24    hdrs = ["util.h"],
25    defines = ["BAZEL_BUILD"],
26    deps = [
27        "//:grpc++",
28        "//:grpc++_reflection",
29        "//examples/protos:helloworld_cc_grpc",
30        "@io_opentelemetry_cpp//sdk/src/metrics",
31    ],
32)
33
34cc_binary(
35    name = "greeter_callback_client",
36    srcs = ["greeter_callback_client.cc"],
37    defines = ["BAZEL_BUILD"],
38    deps = [
39        "util",
40        "//:grpc++",
41        "//:grpcpp_otel_plugin",
42        "@com_google_absl//absl/flags:flag",
43        "@com_google_absl//absl/flags:parse",
44        "@io_opentelemetry_cpp//exporters/prometheus:prometheus_exporter",
45        "@io_opentelemetry_cpp//sdk/src/metrics",
46    ],
47)
48
49cc_binary(
50    name = "greeter_callback_server",
51    srcs = ["greeter_callback_server.cc"],
52    defines = ["BAZEL_BUILD"],
53    deps = [
54        "util",
55        "//:grpc++",
56        "//:grpcpp_otel_plugin",
57        "@com_google_absl//absl/flags:flag",
58        "@com_google_absl//absl/flags:parse",
59        "@com_google_absl//absl/strings:str_format",
60        "@io_opentelemetry_cpp//exporters/prometheus:prometheus_exporter",
61        "@io_opentelemetry_cpp//sdk/src/metrics",
62    ],
63)
64