[otel] Add bazel dependency (#33548)
Add bazel dependency on opentelemetry-cpp. <!-- If you know who should review your pull request, please assign it to that person, otherwise the pull request would get assigned randomly. If your pull request is for a specific language, please add the appropriate lang label. -->pull/33558/head
parent
16a11fadff
commit
875b7fdcff
7 changed files with 109 additions and 0 deletions
@ -0,0 +1,38 @@ |
||||
# 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("//bazel:grpc_build_system.bzl", "grpc_cc_test", "grpc_package") |
||||
|
||||
licenses(["notice"]) |
||||
|
||||
grpc_package( |
||||
name = "test/cpp/ext/filters/otel", |
||||
visibility = "tests", |
||||
) |
||||
|
||||
grpc_cc_test( |
||||
name = "otel_plugin_test", |
||||
srcs = [ |
||||
"otel_plugin_test.cc", |
||||
], |
||||
external_deps = [ |
||||
"gtest", |
||||
"otel/api", |
||||
"otel/sdk/src/metrics", |
||||
], |
||||
language = "C++", |
||||
tags = [ |
||||
], |
||||
deps = ["//test/core/util:grpc_test_util"], |
||||
) |
@ -0,0 +1,46 @@ |
||||
//
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
//
|
||||
|
||||
#include "api/include/opentelemetry/metrics/provider.h" |
||||
#include "gmock/gmock.h" |
||||
#include "gtest/gtest.h" |
||||
#include "sdk/include/opentelemetry/sdk/metrics/meter_provider.h" |
||||
|
||||
#include "test/core/util/test_config.h" |
||||
|
||||
namespace grpc { |
||||
namespace testing { |
||||
namespace { |
||||
|
||||
TEST(OTelPluginTest, ApiDependency) { |
||||
opentelemetry::metrics::Provider::GetMeterProvider(); |
||||
} |
||||
|
||||
TEST(OTelPluginTest, SdkDependency) { |
||||
opentelemetry::sdk::metrics::MeterProvider(); |
||||
} |
||||
|
||||
} // namespace
|
||||
} // namespace testing
|
||||
} // namespace grpc
|
||||
|
||||
int main(int argc, char** argv) { |
||||
grpc::testing::TestEnvironment env(&argc, argv); |
||||
::testing::InitGoogleTest(&argc, argv); |
||||
return RUN_ALL_TESTS(); |
||||
} |
Loading…
Reference in new issue