blob: 30d23287efea5b9b3fd0ffbd36393c913a111ffb [file] [log] [blame]
Yash Tibrewal60a1b4a2022-08-30 00:22:031# gRPC Bazel BUILD file.
2#
3# Copyright 2022 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(
Yash Tibrewal0a7d1312022-08-30 15:55:3225 default_visibility = ["//visibility:public"],
Yash Tibrewal60a1b4a2022-08-30 00:22:0326 features = [
27 "layering_check",
Yash Tibrewal60a1b4a2022-08-30 00:22:0328 ],
29)
30
Yash Tibrewal60a1b4a2022-08-30 00:22:0331grpc_cc_library(
32 name = "observability",
33 srcs = [
34 "observability.cc",
35 ],
36 hdrs = [
Yash Tibrewal727ae8c2022-10-17 19:43:4537 "//:include/grpcpp/ext/gcp_observability.h",
Yash Tibrewal60a1b4a2022-08-30 00:22:0338 ],
39 external_deps = [
Yash Tibrewalb3ad8942022-09-13 18:47:1940 "absl/status",
41 "absl/status:statusor",
Yash Tibrewal184d4822023-02-23 07:35:2042 "absl/strings",
Yash Tibrewalbdd1ac42023-04-05 21:45:2143 "absl/time",
Yash Tibrewal184d4822023-02-23 07:35:2044 "google/api:monitored_resource_cc_proto",
Yash Tibrewald7266f42022-09-28 23:09:1345 "googleapis_monitoring_grpc_service",
Yash Tibrewald1974992022-11-22 00:52:2646 "googleapis_trace_grpc_service",
Yash Tibrewal4ccb8022022-09-28 22:37:5047 "opencensus-stats",
Yash Tibrewald1974992022-11-22 00:52:2648 "opencensus-stats-stackdriver_exporter",
Yash Tibrewal60a1b4a2022-08-30 00:22:0349 "opencensus-trace",
50 "opencensus-trace-stackdriver_exporter",
Yash Tibrewal60a1b4a2022-08-30 00:22:0351 ],
Craig Tiller48274032025-03-04 03:31:2452 tags = [
53 # uses OSS specific libraries
54 "grpc:broken-internally",
55 ],
Yash Tibrewal727ae8c2022-10-17 19:43:4556 visibility = ["//:__subpackages__"],
Yash Tibrewal60a1b4a2022-08-30 00:22:0357 deps = [
Yash Tibrewal4b05dc82023-02-20 06:25:2358 "environment_autodetect",
Yash Tibrewald1974992022-11-22 00:52:2659 "observability_config",
Yash Tibrewal062afbd2023-01-10 23:42:1960 "observability_logging_sink",
Yash Tibrewal60a1b4a2022-08-30 00:22:0361 "//:gpr",
Yash Tibrewal6f960be2023-03-13 22:08:4562 "//:grpc",
Yash Tibrewald1974992022-11-22 00:52:2663 "//:grpc++",
Yash Tibrewalbf1a26c2023-03-22 22:31:4764 "//:grpc++_base",
Yash Tibrewal60a1b4a2022-08-30 00:22:0365 "//:grpc_opencensus_plugin",
Yash Tibrewal7af4bc72023-02-25 00:41:3966 "//src/core:logging_filter",
Yash Tibrewal6f960be2023-03-13 22:08:4567 "//src/core:notification",
Yash Tibrewal60a1b4a2022-08-30 00:22:0368 ],
69)
Yash Tibrewal260a02d2022-09-08 20:43:3770
71grpc_cc_library(
72 name = "observability_config",
Yash Tibrewalf7f4c9b2022-09-09 22:14:1573 srcs = [
74 "observability_config.cc",
75 ],
Yash Tibrewal260a02d2022-09-08 20:43:3776 hdrs = [
77 "observability_config.h",
78 ],
Yash Tibrewalf7f4c9b2022-09-09 22:14:1579 external_deps = [
80 "absl/status",
81 "absl/status:statusor",
82 "absl/strings",
Yash Tibrewalf7f4c9b2022-09-09 22:14:1583 ],
Xuan Wang629b7a12023-06-05 23:11:5284 visibility = [
Craig Tiller536094c2025-03-31 16:52:5785 "//bazel:grpc_python_observability",
Xuan Wang629b7a12023-06-05 23:11:5286 "//test:__subpackages__",
Xuan Wang629b7a12023-06-05 23:11:5287 ],
Yash Tibrewal260a02d2022-09-08 20:43:3788 deps = [
89 "//:gpr",
Yash Tibrewalf7f4c9b2022-09-09 22:14:1590 "//:grpc_public_hdrs",
Yash Tibrewal5f6c3572022-10-21 03:12:5391 "//src/core:env",
Craig Tiller5b8f0062022-11-09 04:04:3192 "//src/core:error",
Craig Tillerd8d67f32024-01-10 19:54:3093 "//src/core:error_utils",
Yash Tibrewal5f6c3572022-10-21 03:12:5394 "//src/core:json",
95 "//src/core:json_args",
96 "//src/core:json_object_loader",
Mark D. Roth36d27162023-03-30 20:30:5497 "//src/core:json_reader",
Mark D. Roth41606052024-02-09 23:13:3998 "//src/core:load_file",
Cheng-Yu Chung3ef817b2022-11-15 18:47:2799 "//src/core:slice",
Yash Tibrewal5f6c3572022-10-21 03:12:53100 "//src/core:slice_refcount",
101 "//src/core:status_helper",
Yash Tibrewala99a65b2022-11-01 00:02:20102 "//src/core:validation_errors",
Yash Tibrewal260a02d2022-09-08 20:43:37103 ],
104)
Yash Tibrewal829f41b2022-11-09 22:13:20105
106grpc_cc_library(
107 name = "observability_logging_sink",
108 srcs = [
109 "observability_logging_sink.cc",
110 ],
111 hdrs = [
112 "observability_logging_sink.h",
113 ],
Yash Tibrewal54dd7562022-11-10 01:42:29114 external_deps = [
Yash Tibrewalbf23bb22023-02-23 06:32:44115 "absl/base:core_headers",
Yash Tibrewal90d33ff2025-01-28 04:49:34116 "absl/log",
Yash Tibrewalfcff4bd2023-03-24 02:07:13117 "absl/numeric:int128",
Yash Tibrewal54dd7562022-11-10 01:42:29118 "absl/strings",
Yash Tibrewal15c4a982022-11-21 22:32:04119 "absl/strings:str_format",
Yash Tibrewale7f1e9d2023-01-23 18:01:16120 "google/api:monitored_resource_cc_proto",
Craig Tiller67f364e2023-01-11 16:50:32121 "googleapis_logging_cc_proto",
Yash Tibrewal7372e552022-11-17 19:12:36122 "googleapis_logging_grpc_service",
Mark D. Roth5e4d9f42022-12-06 00:32:04123 "protobuf_headers",
Yash Tibrewal54dd7562022-11-10 01:42:29124 ],
Craig Tiller48274032025-03-04 03:31:24125 tags = [
126 # uses OSS specific libraries
127 "grpc:broken-internally",
128 ],
Yash Tibrewal829f41b2022-11-09 22:13:20129 visibility = ["//test:__subpackages__"],
130 deps = [
Yash Tibrewalbf23bb22023-02-23 06:32:44131 "environment_autodetect",
Yash Tibrewald1974992022-11-22 00:52:26132 "observability_config",
Craig Tiller3717ff02023-07-26 16:19:35133 "//:channel_arg_names",
Yash Tibrewalbf23bb22023-02-23 06:32:44134 "//:event_engine_base_hdrs",
Craig Tiller49a30352022-12-19 16:18:39135 "//:gpr",
Yash Tibrewal829f41b2022-11-09 22:13:20136 "//:gpr_platform",
Yash Tibrewal7372e552022-11-17 19:12:36137 "//:grpc++",
138 "//:grpc_opencensus_plugin",
Yash Tibrewalbf23bb22023-02-23 06:32:44139 "//src/core:default_event_engine",
Yash Tibrewal7372e552022-11-17 19:12:36140 "//src/core:env",
Craig Tiller49a30352022-12-19 16:18:39141 "//src/core:json",
Yash Tibrewal7af4bc72023-02-25 00:41:39142 "//src/core:logging_sink",
Yash Tibrewal90d33ff2025-01-28 04:49:34143 "//src/core:sync",
Craig Tiller49a30352022-12-19 16:18:39144 "//src/core:time",
Yash Tibrewalfcff4bd2023-03-24 02:07:13145 "//src/core:uuid_v4",
Yash Tibrewal829f41b2022-11-09 22:13:20146 ],
147)
Yash Tibrewal04e3a8e2023-02-17 00:20:20148
149grpc_cc_library(
150 name = "environment_autodetect",
151 srcs = [
152 "environment_autodetect.cc",
153 ],
154 hdrs = [
155 "environment_autodetect.h",
156 ],
157 external_deps = [
158 "absl/base:core_headers",
159 "absl/container:flat_hash_map",
160 "absl/functional:any_invocable",
Yash Tibrewal90d33ff2025-01-28 04:49:34161 "absl/log",
Tanvi Jagtapb72d3182024-05-03 06:33:48162 "absl/log:check",
Yash Tibrewal04e3a8e2023-02-17 00:20:20163 "absl/status",
164 "absl/status:statusor",
Yash Tibrewal04e3a8e2023-02-17 00:20:20165 ],
Yash Tibrewal04e3a8e2023-02-17 00:20:20166 visibility = [
167 "//src/cpp/ext/gcp:__subpackages__",
168 "//test:__subpackages__",
169 ],
170 deps = [
171 "//:exec_ctx",
172 "//:gpr",
173 "//:gpr_platform",
174 "//:grpc++",
175 "//:grpc_base",
176 "//:grpc_trace",
Mark D. Roth179e0f92024-02-20 19:34:15177 "//:iomgr",
Yash Tibrewal04e3a8e2023-02-17 00:20:20178 "//:orphanable",
179 "//src/core:closure",
180 "//src/core:default_event_engine",
181 "//src/core:env",
182 "//src/core:error",
Adam Heller6899cab2025-06-30 16:40:20183 "//src/core:event_engine_shim",
Yash Tibrewal04e3a8e2023-02-17 00:20:20184 "//src/core:gcp_metadata_query",
185 "//src/core:iomgr_fwd",
186 "//src/core:load_file",
187 "//src/core:slice",
188 "//src/core:status_helper",
Yash Tibrewal90d33ff2025-01-28 04:49:34189 "//src/core:sync",
Yash Tibrewal04e3a8e2023-02-17 00:20:20190 "//src/core:time",
191 ],
192)