metrics_service, als, trace_service: add api_go_grpc bazel rules (#3409)

Add api_go_grpc rules for metrics_service, als, and trace_service.

To support those changes, also added the necessary go_proto_library
rules in the repositories.bzl definitions for prometheus_metrics_model,
and io_opencensus_trace, and augmented the go_build_test.go to
verify these changes were correct.

Signed-off-by: William Chang <mr.williamchang@gmail.com>

Mirrored from https://github.com/envoyproxy/envoy @ fb7797fd7df696cd239cc1d3792719361b62c684
pull/620/head
data-plane-api(CircleCI) 7 years ago
parent ba9086de65
commit 18b0e2a6dd
  1. 18
      bazel/repositories.bzl
  2. 11
      envoy/service/accesslog/v2/BUILD
  3. 9
      envoy/service/metrics/v2/BUILD
  4. 11
      envoy/service/trace/v2/BUILD
  5. 3
      test/build/BUILD
  6. 3
      test/build/go_build_test.go

@ -194,6 +194,7 @@ py_proto_library(
url = "https://github.com/prometheus/client_model/archive/" + PROMETHEUS_SHA + ".tar.gz",
build_file_content = """
load("@envoy_api//bazel:api_build_system.bzl", "api_proto_library")
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
api_proto_library(
name = "client_model",
@ -202,6 +203,13 @@ api_proto_library(
],
visibility = ["//visibility:public"],
)
go_proto_library(
name = "client_model_go_proto",
importpath = "client_model",
proto = ":client_model",
visibility = ["//visibility:public"],
)
""",
)
@ -211,6 +219,7 @@ api_proto_library(
url = "https://github.com/census-instrumentation/opencensus-proto/archive/" + OPENCENSUS_SHA + ".tar.gz",
build_file_content = """
load("@envoy_api//bazel:api_build_system.bzl", "api_proto_library")
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
api_proto_library(
name = "trace_model",
@ -219,7 +228,12 @@ api_proto_library(
],
visibility = ["//visibility:public"],
)
go_proto_library(
name = "trace_model_go_proto",
importpath = "trace_model",
proto = ":trace_model",
visibility = ["//visibility:public"],
)
""",
)

@ -1,4 +1,4 @@
load("//bazel:api_build_system.bzl", "api_proto_library")
load("//bazel:api_build_system.bzl", "api_proto_library", "api_go_grpc_library")
licenses(["notice"]) # Apache 2
@ -12,3 +12,12 @@ api_proto_library(
"//envoy/config/filter/accesslog/v2:accesslog",
],
)
api_go_grpc_library(
name = "als",
proto = ":als",
deps = [
"//envoy/api/v2/core:base_go_proto",
"//envoy/config/filter/accesslog/v2:accesslog_go_proto",
],
)

@ -13,3 +13,12 @@ api_proto_library(
"@promotheus_metrics_model//:client_model",
],
)
api_go_grpc_library(
name = "metrics_service",
proto = ":metrics_service",
deps = [
"//envoy/api/v2/core:base_go_proto",
"@promotheus_metrics_model//:client_model_go_proto",
],
)

@ -1,4 +1,4 @@
load("//bazel:api_build_system.bzl", "api_proto_library")
load("//bazel:api_build_system.bzl", "api_proto_library", "api_go_grpc_library")
licenses(["notice"]) # Apache 2
@ -12,3 +12,12 @@ api_proto_library(
"@io_opencensus_trace//:trace_model",
],
)
api_go_grpc_library(
name = "trace_service",
proto = ":trace_service",
deps = [
"//envoy/api/v2/core:base_go_proto",
"@io_opencensus_trace//:trace_model_go_proto",
],
)

@ -30,9 +30,12 @@ api_go_test(
"//envoy/api/v2:rds_go_grpc",
"//envoy/api/v2/auth:cert_go_proto",
"//envoy/config/bootstrap/v2:bootstrap_go_proto",
"//envoy/service/accesslog/v2:als_go_grpc",
"//envoy/service/discovery/v2:ads_go_grpc",
"//envoy/service/discovery/v2:hds_go_grpc",
"//envoy/service/discovery/v2:sds_go_grpc",
"//envoy/service/metrics/v2:metrics_service_go_grpc",
"//envoy/service/ratelimit/v2:rls_go_grpc",
"//envoy/service/trace/v2:trace_service_go_grpc",
],
)

@ -13,6 +13,9 @@ import (
_ "github.com/envoyproxy/data-plane-api/api/rds"
_ "github.com/envoyproxy/data-plane-api/api/rls"
_ "github.com/envoyproxy/data-plane-api/api/sds"
_ "github.com/envoyproxy/data-plane-api/api/als"
_ "github.com/envoyproxy/data-plane-api/api/metrics_service"
_ "github.com/envoyproxy/data-plane-api/api/trace_service"
)
func TestNoop(t *testing.T) {

Loading…
Cancel
Save