stat_sinks: add OpenTelemetry stats sink (#26620)

Signed-off-by: ohadvano <ohadvano@gmail.com>

Mirrored from https://github.com/envoyproxy/envoy @ a6d46b6ac4750720eec9a49abe701f0df9bf8e0a
pull/626/head
data-plane-api(Azure Pipelines) 2 years ago
parent daea3904e5
commit b746e276b4
  1. 1
      BUILD
  2. 3
      bazel/external_proto_deps.bzl
  3. 20
      bazel/repositories.bzl
  4. 12
      envoy/extensions/stat_sinks/open_telemetry/v3/BUILD
  5. 47
      envoy/extensions/stat_sinks/open_telemetry/v3/open_telemetry.proto
  6. 1
      versioning/BUILD

@ -286,6 +286,7 @@ proto_library(
"//envoy/extensions/retry/host/previous_hosts/v3:pkg",
"//envoy/extensions/retry/priority/previous_priorities/v3:pkg",
"//envoy/extensions/stat_sinks/graphite_statsd/v3:pkg",
"//envoy/extensions/stat_sinks/open_telemetry/v3:pkg",
"//envoy/extensions/stat_sinks/wasm/v3:pkg",
"//envoy/extensions/transport_sockets/alts/v3:pkg",
"//envoy/extensions/transport_sockets/http_11_proxy/v3:pkg",

@ -34,6 +34,7 @@ EXTERNAL_PROTO_GO_BAZEL_DEP_MAP = {
"@opencensus_proto//opencensus/proto/trace/v1:trace_config_proto": "@opencensus_proto//opencensus/proto/trace/v1:trace_and_config_proto_go",
"@opentelemetry_proto//:trace": "@opentelemetry_proto//:trace_go_proto",
"@opentelemetry_proto//:logs": "@opentelemetry_proto//:logs_go_proto",
"@opentelemetry_proto//:metrics": "@opentelemetry_proto//:metrics_go_proto",
"@opentelemetry_proto//:common": "@opentelemetry_proto//:common_go_proto",
}
@ -45,6 +46,7 @@ EXTERNAL_PROTO_CC_BAZEL_DEP_MAP = {
"@opencensus_proto//opencensus/proto/trace/v1:trace_config_proto": "@opencensus_proto//opencensus/proto/trace/v1:trace_config_proto_cc",
"@opentelemetry_proto//:trace": "@opentelemetry_proto//:trace_cc_proto",
"@opentelemetry_proto//:logs": "@opentelemetry_proto//:logs_cc_proto",
"@opentelemetry_proto//:metrics": "@opentelemetry_proto//:metrics_cc_proto",
"@opentelemetry_proto//:common": "@opentelemetry_proto//:common_cc_proto",
}
@ -56,5 +58,6 @@ EXTERNAL_PROTO_PY_BAZEL_DEP_MAP = {
"@opencensus_proto//opencensus/proto/trace/v1:trace_config_proto": "@opencensus_proto//opencensus/proto/trace/v1:trace_config_proto_py",
"@opentelemetry_proto//:trace": "@opentelemetry_proto//:trace_py_proto",
"@opentelemetry_proto//:logs": "@opentelemetry_proto//:logs_py_proto",
"@opentelemetry_proto//:metrics": "@opentelemetry_proto//:metrics_py_proto",
"@opentelemetry_proto//:common": "@opentelemetry_proto//:common_py_proto",
}

@ -163,6 +163,26 @@ go_proto_library(
visibility = ["//visibility:public"],
)
api_cc_py_proto_library(
name = "metrics",
srcs = [
"opentelemetry/proto/collector/metrics/v1/metrics_service.proto",
"opentelemetry/proto/metrics/v1/metrics.proto",
],
deps = [
"//:common",
"//:resource",
],
visibility = ["//visibility:public"],
)
go_proto_library(
name = "metrics_go_proto",
importpath = "go.opentelemetry.io/proto/otlp/metrics/v1",
proto = ":metrics",
visibility = ["//visibility:public"],
)
api_cc_py_proto_library(
name = "trace",
srcs = [

@ -0,0 +1,12 @@
# 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/v3:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
],
)

@ -0,0 +1,47 @@
syntax = "proto3";
package envoy.extensions.stat_sinks.open_telemetry.v3;
import "envoy/config/core/v3/grpc_service.proto";
import "google/protobuf/wrappers.proto";
import "udpa/annotations/status.proto";
import "validate/validate.proto";
option java_package = "io.envoyproxy.envoy.extensions.stat_sinks.open_telemetry.v3";
option java_outer_classname = "OpenTelemetryProto";
option java_multiple_files = true;
option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/stat_sinks/open_telemetry/v3;open_telemetryv3";
option (udpa.annotations.file_status).package_version_status = ACTIVE;
// [#protodoc-title: Open Telemetry Stats Sink]
// Stats configuration proto schema for ``envoy.stat_sinks.open_telemetry`` sink.
// [#extension: envoy.stat_sinks.open_telemetry]
// [#next-free-field: 6]
message SinkConfig {
oneof protocol_specifier {
option (validate.required) = true;
// The upstream gRPC cluster that implements the OTLP/gRPC collector.
config.core.v3.GrpcService grpc_service = 1 [(validate.rules).message = {required: true}];
}
// If set to true, counters will be emitted as deltas, and the OTLP message will have
// ``AGGREGATION_TEMPORALITY_DELTA`` set as AggregationTemporality.
bool report_counters_as_deltas = 2;
// If set to true, histograms will be emitted as deltas, and the OTLP message will have
// ``AGGREGATION_TEMPORALITY_DELTA`` set as AggregationTemporality.
bool report_histograms_as_deltas = 3;
// If set to true, metrics will have their tags emitted as OTLP attributes, which may
// contain values used by the tag extractor or additional tags added during stats creation.
// Otherwise, no attributes will be associated with the export message. Default value is true.
google.protobuf.BoolValue emit_tags_as_attributes = 4;
// If set to true, metric names will be represented as the tag extracted name instead
// of the full metric name. Default value is true.
google.protobuf.BoolValue use_tag_extracted_name = 5;
}

@ -225,6 +225,7 @@ proto_library(
"//envoy/extensions/retry/host/previous_hosts/v3:pkg",
"//envoy/extensions/retry/priority/previous_priorities/v3:pkg",
"//envoy/extensions/stat_sinks/graphite_statsd/v3:pkg",
"//envoy/extensions/stat_sinks/open_telemetry/v3:pkg",
"//envoy/extensions/stat_sinks/wasm/v3:pkg",
"//envoy/extensions/transport_sockets/alts/v3:pkg",
"//envoy/extensions/transport_sockets/http_11_proxy/v3:pkg",

Loading…
Cancel
Save