opentelemetry tracer: add OTLP/HTTP exporter (#29207)

* Refactor gRPC exporter to use general base class we can later reuse

Signed-off-by: Alex Ellis <ellisonjtk@gmail.com>

* Update OpenTelemetryConfig with HTTP-related config

Signed-off-by: Alex Ellis <ellisonjtk@gmail.com>

* Write and wire up HTTP trace exporter

Signed-off-by: Alex Ellis <ellisonjtk@gmail.com>

* Code formatting

Signed-off-by: Alex Ellis <ellisonjtk@gmail.com>

* Proto format

Signed-off-by: Alex Ellis <ellisonjtk@gmail.com>

* Add basic tests

Signed-off-by: Alex Ellis <ellisonjtk@gmail.com>

* code format

Signed-off-by: Alex Ellis <ellisonjtk@gmail.com>

* Add additional counters for http exporter and test

Signed-off-by: Alex Ellis <ellisonjtk@gmail.com>

* Formatting

Signed-off-by: Alex Ellis <ellisonjtk@gmail.com>

* Coverage improvements

Signed-off-by: Alex Ellis <ellisonjtk@gmail.com>

* Formatting

Signed-off-by: Alex Ellis <ellisonjtk@gmail.com>

* Add higher level Driver test for HTTP exporting

Signed-off-by: Alex Ellis <ellisonjtk@gmail.com>

* More formatting

Signed-off-by: Alex Ellis <ellisonjtk@gmail.com>

* Clang tidy

Signed-off-by: Alex Ellis <ellisonjtk@gmail.com>

* Refactor config and add HTTP headers

Signed-off-by: Joao Grassi <joao.grassi@dynatrace.com>

* Modify tests

Signed-off-by: Joao Grassi <joao.grassi@dynatrace.com>

* Fix lint errors

Signed-off-by: Joao Grassi <joao.grassi@dynatrace.com>

* Revert oneof in proto config

Re-allow not having a grpc_service specified to keep the existing behavior. Added a condition to fail-fast when both exporters are configured.

Signed-off-by: Joao Grassi <joao.grassi@dynatrace.com>

* PR suggestions

Signed-off-by: Joao Grassi <joao.grassi@dynatrace.com>

* Add HttpService config type

Signed-off-by: Joao Grassi <joao.grassi@dynatrace.com>

* Fix format issues

Signed-off-by: Joao Grassi <joao.grassi@dynatrace.com>

* Fix lint/format/docs issues

Signed-off-by: Joao Grassi <joao.grassi@dynatrace.com>

* Hostname -> Authority

Signed-off-by: Joao Grassi <joao.grassi@dynatrace.com>

* Use HttpUri type

Signed-off-by: Joao Grassi <joao.grassi@dynatrace.com>

* PR suggestions

Signed-off-by: Joao Grassi <joao.grassi@dynatrace.com>

* Improve log messages

Signed-off-by: Joao Grassi <joao.grassi@dynatrace.com>

* Fix format

Signed-off-by: Joao Grassi <joao.grassi@dynatrace.com>

* PR suggestions

Signed-off-by: Joao Grassi <joao.grassi@dynatrace.com>

* PR suggestions

Signed-off-by: Joao Grassi <joao.grassi@dynatrace.com>

* Revert stats for http exporter

Signed-off-by: Joao Grassi <joao.grassi@dynatrace.com>

* Fix spelling

Signed-off-by: Joao Grassi <joao.grassi@dynatrace.com>

* Add changelog

Signed-off-by: Joao Grassi <joao.grassi@dynatrace.com>

* Properly manage in-flight http requests in the exporter

Signed-off-by: Joao Grassi <joao.grassi@dynatrace.com>

* Add proto migrate oneof annotation

Signed-off-by: Joao Grassi <joao.grassi@dynatrace.com>

* Clarify http headers do not support formatting

Signed-off-by: Joao Grassi <joao.grassi@dynatrace.com>

* Prepare headers when creating the HTTP exporter

Signed-off-by: Joao Grassi <joao.grassi@dynatrace.com>

* Revert test change

Signed-off-by: Joao Grassi <joao.grassi@dynatrace.com>

---------

Signed-off-by: Alex Ellis <ellisonjtk@gmail.com>
Signed-off-by: Joao Grassi <joao.grassi@dynatrace.com>
Co-authored-by: Alex Ellis <ellisonjtk@gmail.com>

Mirrored from https://github.com/envoyproxy/envoy @ 767cb40d5e655b06e960938eeb43225b6fe57007
main
update-envoy[bot] 1 year ago
parent a8dee5f4b8
commit 9e28231f8c
  1. 35
      envoy/config/core/v3/http_service.proto
  2. 22
      envoy/config/trace/v3/opentelemetry.proto

@ -0,0 +1,35 @@
syntax = "proto3";
package envoy.config.core.v3;
import "envoy/config/core/v3/base.proto";
import "envoy/config/core/v3/http_uri.proto";
import "udpa/annotations/status.proto";
import "validate/validate.proto";
option java_package = "io.envoyproxy.envoy.config.core.v3";
option java_outer_classname = "HttpServiceProto";
option java_multiple_files = true;
option go_package = "github.com/envoyproxy/go-control-plane/envoy/config/core/v3;corev3";
option (udpa.annotations.file_status).package_version_status = ACTIVE;
// [#protodoc-title: HTTP services]
// HTTP service configuration.
message HttpService {
// The service's HTTP URI. For example:
//
// .. code-block:: yaml
//
// http_uri:
// uri: https://www.myserviceapi.com/v1/data
// cluster: www.myserviceapi.com|443
//
HttpUri http_uri = 1;
// Specifies a list of HTTP headers that should be added to each request
// handled by this virtual host.
repeated HeaderValueOption request_headers_to_add = 2
[(validate.rules).repeated = {max_items: 1000}];
}

@ -3,7 +3,9 @@ syntax = "proto3";
package envoy.config.trace.v3;
import "envoy/config/core/v3/grpc_service.proto";
import "envoy/config/core/v3/http_service.proto";
import "udpa/annotations/migrate.proto";
import "udpa/annotations/status.proto";
option java_package = "io.envoyproxy.envoy.config.trace.v3";
@ -19,8 +21,24 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE;
message OpenTelemetryConfig {
// The upstream gRPC cluster that will receive OTLP traces.
// Note that the tracer drops traces if the server does not read data fast enough.
// This field can be left empty to disable reporting traces to the collector.
core.v3.GrpcService grpc_service = 1;
// This field can be left empty to disable reporting traces to the gRPC service.
// Only one of ``grpc_service``, ``http_service`` may be used.
core.v3.GrpcService grpc_service = 1
[(udpa.annotations.field_migrate).oneof_promotion = "otlp_exporter"];
// The upstream HTTP cluster that will receive OTLP traces.
// This field can be left empty to disable reporting traces to the HTTP service.
// Only one of ``grpc_service``, ``http_service`` may be used.
//
// .. note::
//
// Note: The ``request_headers_to_add`` property in the OTLP HTTP exporter service
// does not support the :ref:`format specifier <config_access_log_format>` as used for
// :ref:`HTTP access logging <config_access_log>`.
// The values configured are added as HTTP headers on the OTLP export request
// without any formatting applied.
core.v3.HttpService http_service = 3
[(udpa.annotations.field_migrate).oneof_promotion = "otlp_exporter"];
// The name for the service. This will be populated in the ResourceSpan Resource attributes.
// If it is not provided, it will default to "unknown_service:envoy".

Loading…
Cancel
Save