forked from kgateway-dev/kgateway
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* 7406 trace context support (#7508) * Cherry-pick c511b2f6 onto master branch Initial commit of tracing plugin changes At this point, the plugin should in theory have all translation implemented. However, there is no error checking present in the plugin. A basic unit test exists for this work, but all it does it ensure that no errors occurred. The unit test also does not yet validate the content of the output object. * Only set GrpcService if OcagentAddress is empty This was creating an error in Envoy - if the GrpcService object being sent to Envoy had an empty string, then it would not accept the configuration. * Final version of opencensus changes This commit includes a translation fix and simplification of the API. Originally, we were outputting an object of type GrpcService_EnvoyGrpc_ for the grpcAddress option, but the Envoy plugin only supports the GrpcService_GoogleGrpc_ type. So we fix that here. We also simplify the protobuf API to use a oneof for specifying HTTP or GRPC. I'm committing this now because we have decided to drop using OpenCensus due to the fact that it cannot be reconfigured. A lot of the work on this effort will be discarded, so I am saving it here for posterity. * Rename all strings in opencensus.proto to opentelemetry * Rename opencensus.proto to opentelemetry.proto * Rewrite everything to use opentelemetry instead So far, I have only tested manually, but it seems to work okay. One odd behaviour is that Envoy only seems to report information to the echo server on shutdown. Unit tests aren't doing anything serious at the moment and need to be improved. It will also be necessary to write an e2e test for this. But otherwise, things seem to be working much more smoothly than they did with opencensus. * Replace "Census" with "Telemetry" in function name * Remove autogenerated opencensus documentation file * Update unit test * Add changelog * Add e2e test for opentelemetry * Update docs/content/reference/api/github.com/solo-io/gloo/projects/gloo/api/external/envoy/config/trace/v3/opentelemetry.proto.sk.md Co-authored-by: Art <[email protected]> * Incorporate some changes from Sam * Remove race conditions from e2e tests The major issue here was a pair of variables with near-global scope: collectorApiHit and collectionURLPath. Both of these were triggering go's race condition flags, probably because they were being written to and read from ginkgo's setup and teardown callbacks. There was also an issue in shutting down the collection server, which is addressed by a comment around where the change was made. * Some comments and docstring fixes * Add default statements in tracing plugin type translation * Changelog improvements Co-authored-by: soloio-bulldozer[bot] <48420018+soloio-bulldozer[bot]@users.noreply.github.com> Co-authored-by: Art <[email protected]> * Move changelog to the v1.12.x directory Co-authored-by: soloio-bulldozer[bot] <48420018+soloio-bulldozer[bot]@users.noreply.github.com> Co-authored-by: Art <[email protected]>
- Loading branch information
1 parent
7a0a76e
commit 8533ccc
Showing
22 changed files
with
1,053 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
changelog: | ||
- type: NEW_FEATURE | ||
issueLink: https://github.com/solo-io/gloo/issues/7406 | ||
resolvesIssue: false | ||
description: > | ||
Update the Tracer plugin to support Envoy's OpenTelemetry filter: https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/trace/v3/opentelemetry.proto |
49 changes: 49 additions & 0 deletions
49
...gloo/projects/gloo/api/external/envoy/config/trace/v3/opentelemetry.proto.sk.md
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
6 changes: 4 additions & 2 deletions
6
...ithub.com/solo-io/gloo/projects/gloo/api/v1/options/tracing/tracing.proto.sk.md
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
projects/gloo/api/external/envoy/config/trace/v3/opentelemetry.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
syntax = "proto3"; | ||
|
||
package solo.io.envoy.config.trace.v3; | ||
|
||
import "udpa/annotations/migrate.proto"; | ||
import "udpa/annotations/status.proto"; | ||
import "udpa/annotations/versioning.proto"; | ||
import "validate/validate.proto"; | ||
|
||
import "github.com/solo-io/solo-kit/api/v1/ref.proto"; | ||
|
||
option java_package = "io.envoyproxy.solo.io.envoy.config.trace.v3"; | ||
option java_outer_classname = "OpentelemetryProto"; | ||
option java_multiple_files = true; | ||
option (solo.io.udpa.annotations.file_migrate).move_to_package = "envoy.extensions.tracers.opentelemetry.v4alpha"; | ||
option (solo.io.udpa.annotations.file_status).package_version_status = ACTIVE; | ||
|
||
// [#protodoc-title: OpenTelemetry tracer] | ||
|
||
// Configuration for the OpenTelemetry tracer. | ||
// [#extension: envoy.tracers.opentelemetry] | ||
message OpenTelemetryConfig { | ||
option (solo.io.udpa.annotations.versioning).previous_message_type = | ||
"envoy.config.trace.v2.OpenTelemetryConfig"; | ||
|
||
// The cluster to use for submitting traces to the OpenTelemetry agent. | ||
oneof collector_cluster { | ||
// The upstream to use for submitting traces to the OpenTelemetry agent. | ||
core.solo.io.ResourceRef collector_upstream_ref = 1; | ||
// The name of the Envoy cluster to use for submitting traces to the | ||
// OpenTelemetry agent | ||
string cluster_name = 2; | ||
} | ||
} | ||
|
||
option go_package = "github.com/solo-io/gloo/projects/gloo/pkg/api/external/envoy/config/trace/v3"; | ||
import "extproto/ext.proto"; | ||
option (extproto.hash_all) = true; | ||
option (extproto.clone_all) = true; | ||
option (extproto.equal_all) = true; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
projects/gloo/pkg/api/external/envoy/config/trace/v3/opentelemetry.pb.clone.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.