Skip to content

Commit

Permalink
Sync APIs. @tag-name=gloo-v1.19.0-beta2 (#1380)
Browse files Browse the repository at this point in the history
Co-authored-by: soloio-bot <[email protected]>
  • Loading branch information
soloio-bot and soloio-bot authored Dec 12, 2024
1 parent 238fae2 commit 525d438
Show file tree
Hide file tree
Showing 12 changed files with 840 additions and 118 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ message OpenTelemetryConfig {
// OpenTelemetry agent
string cluster_name = 2;
}

// Optional. If set, the service name will be used as the service name in the trace.
// If this is not set it will be automatically set to the name of the
// listener + the namespace of the Gateway object
string service_name = 3;
}

option go_package = "github.com/solo-io/solo-apis/pkg/api/gloo.solo.io/external/envoy/config/trace/v3";
Expand Down
40 changes: 40 additions & 0 deletions api/gloo/gloo/v1/options/tracing/tracing.proto
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ message ListenerTracingSettings {
repeated TracingTagEnvironmentVariable environment_variables_for_tags = 6;
// Optional. If specified, Envoy will include the literals with the given tag as tracing tags.
repeated TracingTagLiteral literals_for_tags = 7;
// Optional. If specified, Envoy will include tags from the dynamic metadata.
repeated TracingTagMetadata metadata_for_tags = 11;

// Optional
// Create separate tracing span for each upstream request if true. And if this flag is set to true, the tracing provider will assume that Envoy
// will be independent hop in the trace chain and may set span type to client or server based on this flag.
bool spawn_upstream_span = 10;
}

// Contains settings for configuring Envoy's tracing capabilities at the route level.
Expand Down Expand Up @@ -97,3 +104,36 @@ message TracingTagLiteral {
// Static literal value to populate the tag value.
google.protobuf.StringValue value = 2;
}

// Requests can produce traces with custom tags.
// TracingTagMetadata defines a dynamic metadata tag which gets added as custom tag.
message TracingTagMetadata {
enum Kind {
// The metadata is extracted from the stream metadata.
REQUEST = 0;
// The metadata is extracted from the endpoint metadata.
ENDPOINT = 1;
}
// Used to populate the tag name.
string tag = 1;
// The kind of metadata to extract the value from
Kind kind = 2;

message MetadataValue {
// The namespace to extract the value from the metadata.
// If empty will default to JWT principal namespace.
string namespace = 1;
// The key to extract the value from the metadata.
// For example, `principal.iss` or `principal.sub` to extract those claims from the JWT ns
string key = 2;
// The delimiter to use when specifying nested fields.
// Default is `.`.
// This is commonly set to `.`, allowing for nested fields names of the form
// `parent.child.grandchild`
string nested_field_delimiter = 3;
}
// The metadata value to extract the tag value from.
MetadataValue value = 3;
// When no valid metadata is found, the tag value would be populated with this default value if specified, otherwise no tag would be populated.
string default_value = 4;
}
69 changes: 69 additions & 0 deletions pkg/api/gateway.gloo.solo.io/v1alpha1/gateway_parameters_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,18 @@ type AiExtension struct {
// metadataKey: "principal:iss"
// ```
Stats *AiExtensionStats `json:"stats,omitempty"`

// Tracing configuration for the AI Extension.
// +optional
// Example:
// ```yaml
// tracing:
// grpc:
// host: "otel-collector.otel-system.svc"
// port: 4317
// insecure: true
// ```
Tracing *AIExtensionTracing `json:"tracing,omitempty"`
}

func (in *AiExtension) GetEnabled() *bool {
Expand Down Expand Up @@ -726,6 +738,63 @@ func (in *CustomLabel) GetKeyDelimiter() *string {
return in.KeyDelimiter
}

func (in *AiExtension) GetTracing() *AIExtensionTracing {
if in == nil {
return nil
}
return in.Tracing
}

type AIExtensionTracing struct {
// gRPC Config for the OTLP collector.
// Set this to use gRPC streaming of traces to the OTLP collector.
// +optional
Grpc *AIExtensionTracingGrpc `json:"grpc,omitempty"`

// Whether to use insecure connection to the OTLP endpoint.
// This will be false by defautl as HTTPS is recommended.
// +optional
Insecure bool `json:"insecure,omitempty"`
}

func (in *AIExtensionTracing) GetGrpc() *AIExtensionTracingGrpc {
if in == nil {
return nil
}
return in.Grpc
}

func (in *AIExtensionTracing) GetInsecure() bool {
if in == nil {
return false
}
return in.Insecure
}

type AIExtensionTracingGrpc struct {
// The gRPC endpoint for the OTLP collector.
// +kubebuilder:validation:MinLength=1
Host string `json:"host"`

// The port for the OTLP collector.
// +kubebuilder:validation:Minimum=1
Port uint32 `json:"port"`
}

func (in *AIExtensionTracingGrpc) GetHost() string {
if in == nil {
return ""
}
return in.Host
}

func (in *AIExtensionTracingGrpc) GetPort() uint32 {
if in == nil {
return 0
}
return in.Port
}

func init() {
SchemeBuilder.Register(&GatewayParameters{}, &GatewayParametersList{})
}
40 changes: 40 additions & 0 deletions pkg/api/gateway.gloo.solo.io/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

55 changes: 55 additions & 0 deletions pkg/api/gloo.solo.io/v1/options/tracing/tracing.pb.clone.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 525d438

Please sign in to comment.