tracer: Add SkyWalking tracer (#13060)

This patch adds a new tracer to support the SkyWalking tracing mechanism and format.

Risk Level: Low, a new extension.
Testing: Unit
Docs Changes: Added
Release Notes: Added

Signed-off-by: wbpcode <comems@msn.com>

Mirrored from https://github.com/envoyproxy/envoy @ 7d0f89b1011503ecd22f28e347cf7f76cba73057
pull/623/head
data-plane-api(Azure Pipelines) 4 years ago
parent 228fe74944
commit bdfc9f69c8
  1. 31
      bazel/repositories.bzl
  2. 11
      bazel/repository_locations.bzl
  3. 66
      envoy/config/trace/v3/skywalking.proto
  4. 13
      envoy/extensions/tracers/skywalking/v4alpha/BUILD
  5. 68
      envoy/extensions/tracers/skywalking/v4alpha/skywalking.proto

@ -40,6 +40,10 @@ def api_dependencies():
name = "com_github_openzipkin_zipkinapi",
build_file_content = ZIPKINAPI_BUILD_CONTENT,
)
external_http_archive(
name = "com_github_apache_skywalking_data_collect_protocol",
build_file_content = SKYWALKING_DATA_COLLECT_PROTOCOL_BUILD_CONTENT,
)
PROMETHEUSMETRICS_BUILD_CONTENT = """
load("@envoy_api//bazel:api_build_system.bzl", "api_cc_py_proto_library")
@ -101,3 +105,30 @@ go_proto_library(
visibility = ["//visibility:public"],
)
"""
SKYWALKING_DATA_COLLECT_PROTOCOL_BUILD_CONTENT = """
load("@rules_proto//proto:defs.bzl", "proto_library")
load("@rules_cc//cc:defs.bzl", "cc_proto_library")
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
proto_library(
name = "protocol",
srcs = [
"common/Common.proto",
"language-agent/Tracing.proto",
],
visibility = ["//visibility:public"],
)
cc_proto_library(
name = "protocol_cc_proto",
deps = [":protocol"],
visibility = ["//visibility:public"],
)
go_proto_library(
name = "protocol_go_proto",
proto = ":protocol",
visibility = ["//visibility:public"],
)
"""

@ -88,4 +88,15 @@ REPOSITORY_LOCATIONS_SPEC = dict(
release_date = "2020-08-17",
use_category = ["api"],
),
com_github_apache_skywalking_data_collect_protocol = dict(
project_name = "SkyWalking API",
project_desc = "SkyWalking's language independent model and gRPC API Definitions",
project_url = "https://github.com/apache/skywalking-data-collect-protocol",
version = "8.1.0",
sha256 = "ebea8a6968722524d1bcc4426fb6a29907ddc2902aac7de1559012d3eee90cf9",
strip_prefix = "skywalking-data-collect-protocol-{version}",
urls = ["https://github.com/apache/skywalking-data-collect-protocol/archive/v{version}.tar.gz"],
release_date = "2020-07-29",
use_category = ["api"],
),
)

@ -0,0 +1,66 @@
syntax = "proto3";
package envoy.config.trace.v3;
import "envoy/config/core/v3/grpc_service.proto";
import "google/protobuf/wrappers.proto";
import "udpa/annotations/migrate.proto";
import "udpa/annotations/sensitive.proto";
import "udpa/annotations/status.proto";
import "udpa/annotations/versioning.proto";
import "validate/validate.proto";
option java_package = "io.envoyproxy.envoy.config.trace.v3";
option java_outer_classname = "SkywalkingProto";
option java_multiple_files = true;
option (udpa.annotations.file_migrate).move_to_package =
"envoy.extensions.tracers.skywalking.v4alpha";
option (udpa.annotations.file_status).package_version_status = ACTIVE;
// [#protodoc-title: SkyWalking tracer]
// Configuration for the SkyWalking tracer. Please note that if SkyWalking tracer is used as the
// provider of http tracer, then
// :ref:`start_child_span <envoy_v3_api_field_extensions.filters.http.router.v3.Router.start_child_span>`
// in the router must be set to true to get the correct topology and tracing data. Moreover, SkyWalking
// Tracer does not support SkyWalking extension header (``sw8-x``) temporarily.
// [#extension: envoy.tracers.skywalking]
message SkyWalkingConfig {
// SkyWalking collector service.
core.v3.GrpcService grpc_service = 1 [(validate.rules).message = {required: true}];
ClientConfig client_config = 2;
}
// Client config for SkyWalking tracer.
message ClientConfig {
// Service name for SkyWalking tracer. If this field is empty, then local service cluster name
// that configured by :ref:`Bootstrap node <envoy_v3_api_field_config.bootstrap.v3.Bootstrap.node>`
// message's :ref:`cluster <envoy_v3_api_field_config.core.v3.Node.cluster>` field or command line
// option :option:`--service-cluster` will be used. If both this field and local service cluster
// name are empty, ``EnvoyProxy`` is used as the service name by default.
string service_name = 1;
// Service instance name for SkyWalking tracer. If this field is empty, then local service node
// that configured by :ref:`Bootstrap node <envoy_v3_api_field_config.bootstrap.v3.Bootstrap.node>`
// message's :ref:`id <envoy_v3_api_field_config.core.v3.Node.id>` field or command line option
// :option:`--service-node` will be used. If both this field and local service node are empty,
// ``EnvoyProxy`` is used as the instance name by default.
string instance_name = 2;
// Authentication token config for SkyWalking. SkyWalking can use token authentication to secure
// that monitoring application data can be trusted. In current version, Token is considered as a
// simple string.
// [#comment:TODO(wbpcode): Get backend token through the SDS API.]
oneof backend_token_specifier {
// Inline authentication token string.
string backend_token = 3 [(udpa.annotations.sensitive) = true];
}
// Envoy caches the segment in memory when the SkyWalking backend service is temporarily unavailable.
// This field specifies the maximum number of segments that can be cached. If not specified, the
// default is 1024.
google.protobuf.UInt32Value max_cache_size = 4;
}

@ -0,0 +1,13 @@
# DO NOT EDIT. This file is generated by tools/proto_format/proto_sync.py.
load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package")
licenses(["notice"]) # Apache 2
api_proto_package(
deps = [
"//envoy/config/core/v4alpha:pkg",
"//envoy/config/trace/v3:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
],
)

@ -0,0 +1,68 @@
syntax = "proto3";
package envoy.extensions.tracers.skywalking.v4alpha;
import "envoy/config/core/v4alpha/grpc_service.proto";
import "google/protobuf/wrappers.proto";
import "udpa/annotations/sensitive.proto";
import "udpa/annotations/status.proto";
import "udpa/annotations/versioning.proto";
import "validate/validate.proto";
option java_package = "io.envoyproxy.envoy.extensions.tracers.skywalking.v4alpha";
option java_outer_classname = "SkywalkingProto";
option java_multiple_files = true;
option (udpa.annotations.file_status).package_version_status = NEXT_MAJOR_VERSION_CANDIDATE;
// [#protodoc-title: SkyWalking tracer]
// Configuration for the SkyWalking tracer. Please note that if SkyWalking tracer is used as the
// provider of http tracer, then
// :ref:`start_child_span <envoy_v3_api_field_extensions.filters.http.router.v3.Router.start_child_span>`
// in the router must be set to true to get the correct topology and tracing data. Moreover, SkyWalking
// Tracer does not support SkyWalking extension header (``sw8-x``) temporarily.
// [#extension: envoy.tracers.skywalking]
message SkyWalkingConfig {
option (udpa.annotations.versioning).previous_message_type =
"envoy.config.trace.v3.SkyWalkingConfig";
// SkyWalking collector service.
config.core.v4alpha.GrpcService grpc_service = 1 [(validate.rules).message = {required: true}];
ClientConfig client_config = 2;
}
// Client config for SkyWalking tracer.
message ClientConfig {
option (udpa.annotations.versioning).previous_message_type = "envoy.config.trace.v3.ClientConfig";
// Service name for SkyWalking tracer. If this field is empty, then local service cluster name
// that configured by :ref:`Bootstrap node <envoy_v3_api_field_config.bootstrap.v3.Bootstrap.node>`
// message's :ref:`cluster <envoy_v3_api_field_config.core.v3.Node.cluster>` field or command line
// option :option:`--service-cluster` will be used. If both this field and local service cluster
// name are empty, ``EnvoyProxy`` is used as the service name by default.
string service_name = 1;
// Service instance name for SkyWalking tracer. If this field is empty, then local service node
// that configured by :ref:`Bootstrap node <envoy_v3_api_field_config.bootstrap.v3.Bootstrap.node>`
// message's :ref:`id <envoy_v3_api_field_config.core.v3.Node.id>` field or command line option
// :option:`--service-node` will be used. If both this field and local service node are empty,
// ``EnvoyProxy`` is used as the instance name by default.
string instance_name = 2;
// Authentication token config for SkyWalking. SkyWalking can use token authentication to secure
// that monitoring application data can be trusted. In current version, Token is considered as a
// simple string.
// [#comment:TODO(wbpcode): Get backend token through the SDS API.]
oneof backend_token_specifier {
// Inline authentication token string.
string backend_token = 3 [(udpa.annotations.sensitive) = true];
}
// Envoy caches the segment in memory when the SkyWalking backend service is temporarily unavailable.
// This field specifies the maximum number of segments that can be cached. If not specified, the
// default is 1024.
google.protobuf.UInt32Value max_cache_size = 4;
}
Loading…
Cancel
Save