Skip to content

Commit

Permalink
Mark tags to bazel targets (open-telemetry#1075)
Browse files Browse the repository at this point in the history
  • Loading branch information
esigo authored Nov 22, 2021
1 parent 426365c commit 0a924fb
Show file tree
Hide file tree
Showing 16 changed files with 55 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bazel/otel_cc_benchmark.bzl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
def otel_cc_benchmark(name, srcs, deps):
def otel_cc_benchmark(name, srcs, deps, tags = [""]):
"""
Creates targets for the benchmark and related targets.
Expand All @@ -23,15 +23,15 @@ def otel_cc_benchmark(name, srcs, deps):
name = name,
srcs = srcs,
deps = deps + ["@com_github_google_benchmark//:benchmark"],
tags = ["manual"],
tags = tags + ["manual"],
)

# The result of running the benchmark, captured into a text file.
native.genrule(
name = name + "_result",
outs = [name + "_result.txt"],
tools = [":" + name],
tags = ["benchmark_result", "manual"],
tags = tags + ["benchmark_result", "manual"],
testonly = True,
cmd = "$(location :" + name + (") --benchmark_color=false --benchmark_min_time=.1 &> $@"),
)
Expand All @@ -43,5 +43,5 @@ def otel_cc_benchmark(name, srcs, deps):
srcs = srcs,
deps = deps + ["@com_github_google_benchmark//:benchmark"],
args = ["--benchmark_min_time=0"],
tags = ["benchmark"],
tags = tags + ["benchmark"],
)
1 change: 1 addition & 0 deletions examples/batch/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ cc_binary(
"main.cc",
],
linkopts = ["-lpthread"],
tags = ["ostream"],
deps = [
"//api",
"//exporters/ostream:ostream_span_exporter",
Expand Down
3 changes: 3 additions & 0 deletions examples/grpc/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ cc_library(
name = "tracer_common",
srcs = ["tracer_common.h"],
defines = ["BAZEL_BUILD"],
tags = ["ostream"],
deps = [
"//exporters/ostream:ostream_span_exporter",
],
Expand All @@ -35,6 +36,7 @@ cc_binary(
"client.cc",
],
defines = ["BAZEL_BUILD"],
tags = ["ostream"],
deps = [
"messages_cc_grpc",
":tracer_common",
Expand All @@ -50,6 +52,7 @@ cc_binary(
"server.cc",
],
defines = ["BAZEL_BUILD"],
tags = ["ostream"],
deps = [
"messages_cc_grpc",
":tracer_common",
Expand Down
2 changes: 2 additions & 0 deletions examples/http/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ cc_binary(
],
"//conditions:default": [],
}),
tags = ["ostream"],
deps = [
"//api",
"//exporters/ostream:ostream_span_exporter",
Expand All @@ -31,6 +32,7 @@ cc_binary(
"server.h",
"tracer_common.h",
],
tags = ["ostream"],
deps = [
"//api",
"//exporters/ostream:ostream_span_exporter",
Expand Down
1 change: 1 addition & 0 deletions examples/metrics_simple/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ cc_binary(
"main.cc",
],
linkopts = ["-pthread"],
tags = ["ostream"],
deps = [
"//api",
"//exporters/ostream:ostream_metrics_exporter_deprecated",
Expand Down
4 changes: 4 additions & 0 deletions examples/multi_processor/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ cc_binary(
srcs = [
"main.cc",
],
tags = [
"memory",
"ostream",
],
deps = [
"//api",
"//examples/common/foo_library:common_foo_library",
Expand Down
1 change: 1 addition & 0 deletions examples/multithreaded/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ cc_binary(
srcs = [
"main.cc",
],
tags = ["ostream"],
deps = [
"//api",
"//exporters/ostream:ostream_span_exporter",
Expand Down
3 changes: 3 additions & 0 deletions examples/otlp/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ cc_binary(
srcs = [
"grpc_main.cc",
],
tags = ["otlp"],
deps = [
"//api",
"//examples/common/foo_library:common_foo_library",
Expand All @@ -16,6 +17,7 @@ cc_binary(
srcs = [
"http_main.cc",
],
tags = ["otlp"],
deps = [
"//api",
"//examples/common/foo_library:common_foo_library",
Expand All @@ -29,6 +31,7 @@ cc_binary(
srcs = [
"http_log_main.cc",
],
tags = ["otlp"],
deps = [
"//api",
"//examples/common/logs_foo_library:common_logs_foo_library",
Expand Down
1 change: 1 addition & 0 deletions examples/simple/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ cc_binary(
srcs = [
"main.cc",
],
tags = ["ostream"],
deps = [
"//api",
"//examples/common/foo_library:common_foo_library",
Expand Down
2 changes: 2 additions & 0 deletions exporters/elasticsearch/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ cc_library(
"//conditions:default": [],
}),
strip_include_prefix = "include",
tags = ["es"],
deps = [
"//ext:headers",
"//ext/src/http/client/curl:http_client_curl",
Expand All @@ -30,6 +31,7 @@ cc_library(
cc_test(
name = "es_log_exporter_test",
srcs = ["test/es_log_exporter_test.cc"],
tags = ["es"],
deps = [
":es_log_exporter",
"@com_google_googletest//:gtest_main",
Expand Down
3 changes: 3 additions & 0 deletions exporters/etw/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ cc_library(
local_defines = [
"HAVE_MSGPACK",
],
tags = ["etw"],
deps = [
"//api",
"//sdk/src/trace",
Expand All @@ -22,6 +23,7 @@ cc_test(
local_defines = [
"HAVE_MSGPACK",
],
tags = ["etw"],
deps = [
":etw_exporter",
"@com_google_googletest//:gtest_main",
Expand All @@ -35,6 +37,7 @@ cc_test(
local_defines = [
"HAVE_MSGPACK",
],
tags = ["etw"],
deps = [
":etw_exporter",
"@com_google_googletest//:gtest_main",
Expand Down
4 changes: 4 additions & 0 deletions exporters/memory/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ cc_library(
"include/opentelemetry/exporters/memory/in_memory_span_data.h",
],
strip_include_prefix = "include",
tags = ["memory"],
deps = [
"//api",
"//sdk/src/resource",
Expand All @@ -15,6 +16,7 @@ cc_library(

cc_test(
name = "in_memory_span_data_test",
tags = ["memory"],
deps = [
":in_memory_span_data",
"@com_google_googletest//:gtest_main",
Expand All @@ -27,6 +29,7 @@ cc_library(
"include/opentelemetry/exporters/memory/in_memory_span_exporter.h",
],
strip_include_prefix = "include",
tags = ["memory"],
deps = [
":in_memory_span_data",
"//sdk/src/trace",
Expand All @@ -35,6 +38,7 @@ cc_library(

cc_test(
name = "in_memory_span_exporter_test",
tags = ["memory"],
deps = [
":in_memory_span_exporter",
"@com_google_googletest//:gtest_main",
Expand Down
7 changes: 7 additions & 0 deletions exporters/ostream/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ cc_library(
"include/opentelemetry/exporters/ostream/log_exporter.h",
],
strip_include_prefix = "include",
tags = ["ostream"],
deps = [
"//sdk/src/logs",
],
Expand All @@ -17,6 +18,7 @@ cc_library(
cc_test(
name = "ostream_log_test",
srcs = ["test/ostream_log_test.cc"],
tags = ["ostream"],
deps = [
":ostream_log_exporter",
"@com_google_googletest//:gtest_main",
Expand All @@ -32,6 +34,7 @@ cc_library(
"include/opentelemetry/exporters/ostream/metrics_exporter.h",
],
strip_include_prefix = "include",
tags = ["ostream"],
deps = [
"//sdk/src/_metrics:metrics_deprecated",
],
Expand All @@ -40,6 +43,7 @@ cc_library(
cc_test(
name = "ostream_metrics_test",
srcs = ["test/ostream_metrics_test.cc"],
tags = ["ostream"],
deps = [
":ostream_metrics_exporter_deprecated",
"@com_google_googletest//:gtest_main",
Expand All @@ -55,6 +59,7 @@ cc_library(
"include/opentelemetry/exporters/ostream/span_exporter.h",
],
strip_include_prefix = "include",
tags = ["ostream"],
deps = [
"//sdk/src/trace",
],
Expand All @@ -65,6 +70,7 @@ cc_library(
hdrs = [
"test/ostream_capture.h",
],
tags = ["ostream"],
deps = [
"//api",
],
Expand All @@ -73,6 +79,7 @@ cc_library(
cc_test(
name = "ostream_span_test",
srcs = ["test/ostream_span_test.cc"],
tags = ["ostream"],
deps = [
":ostream_capture",
":ostream_span_exporter",
Expand Down
12 changes: 12 additions & 0 deletions exporters/otlp/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ cc_library(
"include/opentelemetry/exporters/otlp/protobuf_include_suffix.h",
],
strip_include_prefix = "include",
tags = ["otlp"],
deps = [
"//sdk/src/logs",
"//sdk/src/resource",
Expand All @@ -53,6 +54,7 @@ cc_library(
"include/opentelemetry/exporters/otlp/protobuf_include_suffix.h",
],
strip_include_prefix = "include",
tags = ["otlp"],
deps = [
":otlp_recordable",
"//ext:headers",
Expand Down Expand Up @@ -86,6 +88,7 @@ cc_library(
"//conditions:default": [],
}),
strip_include_prefix = "include",
tags = ["otlp"],
deps = [
"//api",
"//ext/src/http/client/curl:http_client_curl",
Expand All @@ -107,6 +110,7 @@ cc_library(
"include/opentelemetry/exporters/otlp/protobuf_include_suffix.h",
],
strip_include_prefix = "include",
tags = ["otlp"],
deps = [
":otlp_http_client",
":otlp_recordable",
Expand All @@ -127,6 +131,7 @@ cc_library(
"include/opentelemetry/exporters/otlp/protobuf_include_suffix.h",
],
strip_include_prefix = "include",
tags = ["otlp"],
deps = [
":otlp_http_client",
":otlp_recordable",
Expand All @@ -148,6 +153,7 @@ cc_library(
"include/opentelemetry/exporters/otlp/protobuf_include_suffix.h",
],
strip_include_prefix = "include",
tags = ["otlp"],
deps = [
":otlp_recordable",
"//ext:headers",
Expand All @@ -162,6 +168,7 @@ cc_library(
cc_test(
name = "otlp_recordable_test",
srcs = ["test/otlp_recordable_test.cc"],
tags = ["otlp"],
deps = [
":otlp_recordable",
"@com_google_googletest//:gtest_main",
Expand All @@ -171,6 +178,7 @@ cc_test(
cc_test(
name = "otlp_grpc_exporter_test",
srcs = ["test/otlp_grpc_exporter_test.cc"],
tags = ["otlp"],
deps = [
":otlp_grpc_exporter",
"//api",
Expand All @@ -181,6 +189,7 @@ cc_test(
cc_test(
name = "otlp_http_exporter_test",
srcs = ["test/otlp_http_exporter_test.cc"],
tags = ["otlp"],
deps = [
":otlp_http_exporter",
"//api",
Expand All @@ -191,6 +200,7 @@ cc_test(
cc_test(
name = "otlp_http_log_exporter_test",
srcs = ["test/otlp_http_log_exporter_test.cc"],
tags = ["otlp"],
deps = [
":otlp_http_log_exporter",
"//api",
Expand All @@ -201,6 +211,7 @@ cc_test(
cc_test(
name = "otlp_grpc_log_exporter_test",
srcs = ["test/otlp_grpc_log_exporter_test.cc"],
tags = ["otlp"],
deps = [
":otlp_grpc_log_exporter",
"//api",
Expand All @@ -212,6 +223,7 @@ cc_test(
otel_cc_benchmark(
name = "otlp_grpc_exporter_benchmark",
srcs = ["test/otlp_grpc_exporter_benchmark.cc"],
tags = ["otlp"],
deps = [
":otlp_grpc_exporter",
],
Expand Down
4 changes: 4 additions & 0 deletions exporters/prometheus/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ cc_library(
"include/opentelemetry/exporters/prometheus/prometheus_exporter.h",
],
strip_include_prefix = "include",
tags = ["prometheus"],
deps = [
":prometheus_collector",
":prometheus_exporter_utils",
Expand All @@ -42,6 +43,7 @@ cc_library(
"include/opentelemetry/exporters/prometheus/prometheus_exporter_utils.h",
],
strip_include_prefix = "include",
tags = ["prometheus"],
deps = [
"//api",
"//sdk:headers",
Expand All @@ -59,6 +61,7 @@ cc_library(
"include/opentelemetry/exporters/prometheus/prometheus_collector.h",
],
strip_include_prefix = "include",
tags = ["prometheus"],
deps = [
":prometheus_exporter_utils",
"//api",
Expand All @@ -73,6 +76,7 @@ cc_test(
srcs = [
"test/prometheus_exporter_test.cc",
],
tags = ["prometheus"],
deps = [
":prometheus_exporter",
"@com_google_googletest//:gtest_main",
Expand Down
Loading

0 comments on commit 0a924fb

Please sign in to comment.