| # Copyright 2023 gRPC authors. |
| # |
| # 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 |
| # |
| # http://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("@grpc_python_dependencies//:requirements.bzl", "requirement") |
| load("//bazel:cython_library.bzl", "pyx_library") |
| |
| package(default_visibility = ["//visibility:private"]) |
| |
| cc_library( |
| name = "observability", |
| srcs = [ |
| "client_call_tracer.cc", |
| "observability_util.cc", |
| "python_census_context.cc", |
| "rpc_encoding.cc", |
| "sampler.cc", |
| "server_call_tracer.cc", |
| ], |
| hdrs = [ |
| "client_call_tracer.h", |
| "constants.h", |
| "observability_util.h", |
| "python_census_context.h", |
| "rpc_encoding.h", |
| "sampler.h", |
| "server_call_tracer.h", |
| ], |
| includes = ["."], |
| deps = [ |
| "//:grpc_base", |
| ], |
| ) |
| |
| pyx_library( |
| name = "cyobservability", |
| srcs = [ |
| "_cyobservability.pxd", |
| "_cyobservability.pyx", |
| ], |
| deps = [ |
| ":observability", |
| ], |
| ) |
| |
| # Since `opentelemetry-sdk` and `opentelemetry-api` are non-hermetic, |
| # pyobservability is for internal use only. |
| py_library( |
| name = "_opentelemetry_observability", |
| srcs = [ |
| "_open_telemetry_measures.py", |
| "_open_telemetry_observability.py", |
| "_open_telemetry_plugin.py", |
| ], |
| deps = [ |
| requirement("opentelemetry-sdk"), |
| requirement("opentelemetry-api"), |
| ], |
| ) |
| |
| py_library( |
| name = "pyobservability", |
| srcs = [ |
| "__init__.py", |
| "_observability.py", |
| ], |
| imports = [ |
| ".", |
| "../", |
| ], |
| srcs_version = "PY3ONLY", |
| visibility = [ |
| "//:__subpackages__", |
| ], |
| deps = [ |
| ":_opentelemetry_observability", |
| ":cyobservability", |
| ], |
| ) |