diff --git a/changelog/v1.19.0-beta2/ai-tracing-api.yaml b/changelog/v1.19.0-beta2/ai-tracing-api.yaml
new file mode 100644
index 00000000000..687f4d606f3
--- /dev/null
+++ b/changelog/v1.19.0-beta2/ai-tracing-api.yaml
@@ -0,0 +1,8 @@
+changelog:
+ - type: NEW_FEATURE
+ issueLink: https://github.com/solo-io/solo-projects/issues/7295
+ resolvesIssue: false
+ description: >-
+ Add API for AI related tracing operations, as well as general QOL tracing updates
+ for Gateway API.
+
diff --git a/docs/content/reference/api/github.com/solo-io/gloo/projects/gateway2/api/v1alpha1/gateway_parameters.md b/docs/content/reference/api/github.com/solo-io/gloo/projects/gateway2/api/v1alpha1/gateway_parameters.md
index bf0913a0af0..84784995d36 100644
--- a/docs/content/reference/api/github.com/solo-io/gloo/projects/gateway2/api/v1alpha1/gateway_parameters.md
+++ b/docs/content/reference/api/github.com/solo-io/gloo/projects/gateway2/api/v1alpha1/gateway_parameters.md
@@ -258,6 +258,13 @@ Resource Types:
false |
+
+ tracing |
+ object |
+
+
+ |
+ false |
@@ -1086,6 +1093,77 @@ Resource Types:
+### GatewayParameters.spec.kube.aiExtension.tracing
+[↩ Parent](#gatewayparametersspeckubeaiextension)
+
+
+
+
+
+
+
+
+ Name |
+ Type |
+ Description |
+ Required |
+
+
+
+ grpc |
+ object |
+
+
+ |
+ false |
+
+ insecure |
+ boolean |
+
+
+ |
+ false |
+
+
+
+
+### GatewayParameters.spec.kube.aiExtension.tracing.grpc
+[↩ Parent](#gatewayparametersspeckubeaiextensiontracing)
+
+
+
+
+
+
+
+
+ Name |
+ Type |
+ Description |
+ Required |
+
+
+
+ host |
+ string |
+
+
+ |
+ true |
+
+ port |
+ integer |
+
+
+
+ Format: int32
+ Minimum: 1
+ |
+ true |
+
+
+
+
### GatewayParameters.spec.kube.deployment
[↩ Parent](#gatewayparametersspeckube)
diff --git a/docs/content/reference/api/github.com/solo-io/gloo/projects/gloo/api/v1/options/tracing/tracing.proto.sk.md b/docs/content/reference/api/github.com/solo-io/gloo/projects/gloo/api/v1/options/tracing/tracing.proto.sk.md
index 96d103fe61f..1cbab4631cd 100644
--- a/docs/content/reference/api/github.com/solo-io/gloo/projects/gloo/api/v1/options/tracing/tracing.proto.sk.md
+++ b/docs/content/reference/api/github.com/solo-io/gloo/projects/gloo/api/v1/options/tracing/tracing.proto.sk.md
@@ -16,6 +16,9 @@ weight: 5
- [TracePercentages](#tracepercentages)
- [TracingTagEnvironmentVariable](#tracingtagenvironmentvariable)
- [TracingTagLiteral](#tracingtagliteral)
+- [TracingTagMetadata](#tracingtagmetadata)
+- [MetadataValue](#metadatavalue)
+- [Kind](#kind)
@@ -44,6 +47,8 @@ See [here](https://docs.solo.io/gloo-edge/latest/guides/observability/tracing/)
"openCensusConfig": .solo.io.envoy.config.trace.v3.OpenCensusConfig
"environmentVariablesForTags": []tracing.options.gloo.solo.io.TracingTagEnvironmentVariable
"literalsForTags": []tracing.options.gloo.solo.io.TracingTagLiteral
+"metadataForTags": []tracing.options.gloo.solo.io.TracingTagMetadata
+"spawnUpstreamSpan": bool
```
@@ -58,6 +63,8 @@ See [here](https://docs.solo.io/gloo-edge/latest/guides/observability/tracing/)
| `openCensusConfig` | .solo.io.envoy.config.trace.v3.OpenCensusConfig | Only one of `openCensusConfig`, `zipkinConfig`, `datadogConfig`, or `openTelemetryConfig` can be set. |
| `environmentVariablesForTags` | [[]tracing.options.gloo.solo.io.TracingTagEnvironmentVariable](../tracing.proto.sk/#tracingtagenvironmentvariable) | Optional. If specified, Envoy will include the environment variables with the given tag as tracing tags. |
| `literalsForTags` | [[]tracing.options.gloo.solo.io.TracingTagLiteral](../tracing.proto.sk/#tracingtagliteral) | Optional. If specified, Envoy will include the literals with the given tag as tracing tags. |
+| `metadataForTags` | [[]tracing.options.gloo.solo.io.TracingTagMetadata](../tracing.proto.sk/#tracingtagmetadata) | Optional. If specified, Envoy will include tags from the dynamic metadata. |
+| `spawnUpstreamSpan` | `bool` | 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. |
@@ -154,6 +161,65 @@ TracingTagLiteral defines a literal which gets added as custom tag.
+---
+### TracingTagMetadata
+
+
+Requests can produce traces with custom tags.
+TracingTagMetadata defines a dynamic metadata tag which gets added as custom tag.
+
+```yaml
+"tag": string
+"kind": .tracing.options.gloo.solo.io.TracingTagMetadata.Kind
+"value": .tracing.options.gloo.solo.io.TracingTagMetadata.MetadataValue
+"defaultValue": string
+
+```
+
+| Field | Type | Description |
+| ----- | ---- | ----------- |
+| `tag` | `string` | Used to populate the tag name. |
+| `kind` | [.tracing.options.gloo.solo.io.TracingTagMetadata.Kind](../tracing.proto.sk/#kind) | The kind of metadata to extract the value from. |
+| `value` | [.tracing.options.gloo.solo.io.TracingTagMetadata.MetadataValue](../tracing.proto.sk/#metadatavalue) | The metadata value to extract the tag value from. |
+| `defaultValue` | `string` | When no valid metadata is found, the tag value would be populated with this default value if specified, otherwise no tag would be populated. |
+
+
+
+
+---
+### MetadataValue
+
+
+
+```yaml
+"namespace": string
+"key": string
+"nestedFieldDelimiter": string
+
+```
+
+| Field | Type | Description |
+| ----- | ---- | ----------- |
+| `namespace` | `string` | The namespace to extract the value from the metadata. If empty will default to JWT principal namespace. |
+| `key` | `string` | The key to extract the value from the metadata. For example, `principal.iss` or `principal.sub` to extract those claims from the JWT ns. |
+| `nestedFieldDelimiter` | `string` | 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`. |
+
+
+
+
+---
+### Kind
+
+
+
+| Name | Description |
+| ----- | ----------- |
+| `REQUEST` | The metadata is extracted from the stream metadata. |
+| `ENDPOINT` | The metadata is extracted from the endpoint metadata. |
+
+
+
+
diff --git a/docs/data/ProtoMap.yaml b/docs/data/ProtoMap.yaml
index 4444b2c6aa9..c5602c49ed6 100644
--- a/docs/data/ProtoMap.yaml
+++ b/docs/data/ProtoMap.yaml
@@ -2069,6 +2069,9 @@ apis:
tracing.options.gloo.solo.io.TracingTagLiteral:
relativepath: reference/api/github.com/solo-io/gloo/projects/gloo/api/v1/options/tracing/tracing.proto.sk/#TracingTagLiteral
package: tracing.options.gloo.solo.io
+ tracing.options.gloo.solo.io.TracingTagMetadata:
+ relativepath: reference/api/github.com/solo-io/gloo/projects/gloo/api/v1/options/tracing/tracing.proto.sk/#TracingTagMetadata
+ package: tracing.options.gloo.solo.io
transformation.options.gloo.solo.io.Extraction:
relativepath: reference/api/github.com/solo-io/gloo/projects/gloo/api/v1/options/transformation/transformation.proto.sk/#Extraction
package: transformation.options.gloo.solo.io
diff --git a/install/helm/gloo/crds/gateway.gloo.solo.io_gatewayparameters.yaml b/install/helm/gloo/crds/gateway.gloo.solo.io_gatewayparameters.yaml
index 7e7fb5fbe5f..befda0312d3 100644
--- a/install/helm/gloo/crds/gateway.gloo.solo.io_gatewayparameters.yaml
+++ b/install/helm/gloo/crds/gateway.gloo.solo.io_gatewayparameters.yaml
@@ -267,6 +267,24 @@ spec:
type: object
type: array
type: object
+ tracing:
+ properties:
+ grpc:
+ properties:
+ host:
+ minLength: 1
+ type: string
+ port:
+ format: int32
+ minimum: 1
+ type: integer
+ required:
+ - host
+ - port
+ type: object
+ insecure:
+ type: boolean
+ type: object
type: object
deployment:
properties:
diff --git a/install/helm/gloo/crds/gateway.solo.io_v1_Gateway.yaml b/install/helm/gloo/crds/gateway.solo.io_v1_Gateway.yaml
index a9a3677ee1d..c9db3ef6151 100644
--- a/install/helm/gloo/crds/gateway.solo.io_v1_Gateway.yaml
+++ b/install/helm/gloo/crds/gateway.solo.io_v1_Gateway.yaml
@@ -1065,6 +1065,27 @@ spec:
type: string
type: object
type: array
+ metadataForTags:
+ items:
+ properties:
+ defaultValue:
+ type: string
+ kind:
+ type: string
+ x-kubernetes-int-or-string: true
+ tag:
+ type: string
+ value:
+ properties:
+ key:
+ type: string
+ namespace:
+ type: string
+ nestedFieldDelimiter:
+ type: string
+ type: object
+ type: object
+ type: array
openCensusConfig:
properties:
grpcAddress:
@@ -1137,12 +1158,16 @@ spec:
namespace:
type: string
type: object
+ serviceName:
+ type: string
type: object
requestHeadersForTags:
items:
nullable: true
type: string
type: array
+ spawnUpstreamSpan:
+ type: boolean
tracePercentages:
properties:
clientSamplePercentage:
@@ -1743,6 +1768,27 @@ spec:
type: string
type: object
type: array
+ metadataForTags:
+ items:
+ properties:
+ defaultValue:
+ type: string
+ kind:
+ type: string
+ x-kubernetes-int-or-string: true
+ tag:
+ type: string
+ value:
+ properties:
+ key:
+ type: string
+ namespace:
+ type: string
+ nestedFieldDelimiter:
+ type: string
+ type: object
+ type: object
+ type: array
openCensusConfig:
properties:
grpcAddress:
@@ -1815,12 +1861,16 @@ spec:
namespace:
type: string
type: object
+ serviceName:
+ type: string
type: object
requestHeadersForTags:
items:
nullable: true
type: string
type: array
+ spawnUpstreamSpan:
+ type: boolean
tracePercentages:
properties:
clientSamplePercentage:
@@ -3087,6 +3137,27 @@ spec:
type: string
type: object
type: array
+ metadataForTags:
+ items:
+ properties:
+ defaultValue:
+ type: string
+ kind:
+ type: string
+ x-kubernetes-int-or-string: true
+ tag:
+ type: string
+ value:
+ properties:
+ key:
+ type: string
+ namespace:
+ type: string
+ nestedFieldDelimiter:
+ type: string
+ type: object
+ type: object
+ type: array
openCensusConfig:
properties:
grpcAddress:
@@ -3159,12 +3230,16 @@ spec:
namespace:
type: string
type: object
+ serviceName:
+ type: string
type: object
requestHeadersForTags:
items:
nullable: true
type: string
type: array
+ spawnUpstreamSpan:
+ type: boolean
tracePercentages:
properties:
clientSamplePercentage:
diff --git a/install/helm/gloo/crds/gateway.solo.io_v1_HttpListenerOption.yaml b/install/helm/gloo/crds/gateway.solo.io_v1_HttpListenerOption.yaml
index 7d733186441..4f0dd62f358 100644
--- a/install/helm/gloo/crds/gateway.solo.io_v1_HttpListenerOption.yaml
+++ b/install/helm/gloo/crds/gateway.solo.io_v1_HttpListenerOption.yaml
@@ -1056,6 +1056,27 @@ spec:
type: string
type: object
type: array
+ metadataForTags:
+ items:
+ properties:
+ defaultValue:
+ type: string
+ kind:
+ type: string
+ x-kubernetes-int-or-string: true
+ tag:
+ type: string
+ value:
+ properties:
+ key:
+ type: string
+ namespace:
+ type: string
+ nestedFieldDelimiter:
+ type: string
+ type: object
+ type: object
+ type: array
openCensusConfig:
properties:
grpcAddress:
@@ -1128,12 +1149,16 @@ spec:
namespace:
type: string
type: object
+ serviceName:
+ type: string
type: object
requestHeadersForTags:
items:
nullable: true
type: string
type: array
+ spawnUpstreamSpan:
+ type: boolean
tracePercentages:
properties:
clientSamplePercentage:
diff --git a/install/helm/gloo/crds/gateway.solo.io_v1_MatchableHttpGateway.yaml b/install/helm/gloo/crds/gateway.solo.io_v1_MatchableHttpGateway.yaml
index a2ef19adf12..3fc8f9ce4b8 100644
--- a/install/helm/gloo/crds/gateway.solo.io_v1_MatchableHttpGateway.yaml
+++ b/install/helm/gloo/crds/gateway.solo.io_v1_MatchableHttpGateway.yaml
@@ -1059,6 +1059,27 @@ spec:
type: string
type: object
type: array
+ metadataForTags:
+ items:
+ properties:
+ defaultValue:
+ type: string
+ kind:
+ type: string
+ x-kubernetes-int-or-string: true
+ tag:
+ type: string
+ value:
+ properties:
+ key:
+ type: string
+ namespace:
+ type: string
+ nestedFieldDelimiter:
+ type: string
+ type: object
+ type: object
+ type: array
openCensusConfig:
properties:
grpcAddress:
@@ -1131,12 +1152,16 @@ spec:
namespace:
type: string
type: object
+ serviceName:
+ type: string
type: object
requestHeadersForTags:
items:
nullable: true
type: string
type: array
+ spawnUpstreamSpan:
+ type: boolean
tracePercentages:
properties:
clientSamplePercentage:
diff --git a/pkg/utils/api_conversion/trace.go b/pkg/utils/api_conversion/trace.go
index ca9c0d9b036..bf8a1025c84 100644
--- a/pkg/utils/api_conversion/trace.go
+++ b/pkg/utils/api_conversion/trace.go
@@ -8,6 +8,7 @@ import (
envoy_config_core_v3 "github.com/envoyproxy/go-control-plane/envoy/config/core/v3"
envoytrace "github.com/envoyproxy/go-control-plane/envoy/config/trace/v3"
gatewayv1 "github.com/solo-io/gloo/projects/gateway/pkg/api/v1"
+ "github.com/solo-io/gloo/projects/gateway2/wellknown"
envoytracegloo "github.com/solo-io/gloo/projects/gloo/pkg/api/external/envoy/config/trace/v3"
gloov1 "github.com/solo-io/gloo/projects/gloo/pkg/api/v1"
"github.com/solo-io/go-utils/contextutils"
@@ -117,6 +118,8 @@ func isResourceGateway(resource *gloov1.SourceMetadata_SourceRef) bool {
func gatewayKindsMap() map[string]bool {
return map[string]bool{
resources.Kind(new(gatewayv1.Gateway)): true,
+ // https://github.com/solo-io/gloo/blob/main/projects/gateway2/translator/listener/gateway_listener_translator.go#L492
+ wellknown.GatewayGroup + "/" + wellknown.GatewayKind: true,
}
}
diff --git a/projects/gateway2/api/v1alpha1/gateway_parameters_types.go b/projects/gateway2/api/v1alpha1/gateway_parameters_types.go
index 7daba1f45fd..4bed3067206 100644
--- a/projects/gateway2/api/v1alpha1/gateway_parameters_types.go
+++ b/projects/gateway2/api/v1alpha1/gateway_parameters_types.go
@@ -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 {
@@ -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{})
}
diff --git a/projects/gateway2/api/v1alpha1/zz_generated.deepcopy.go b/projects/gateway2/api/v1alpha1/zz_generated.deepcopy.go
index 212c08e2b49..b51e5d6ecc0 100644
--- a/projects/gateway2/api/v1alpha1/zz_generated.deepcopy.go
+++ b/projects/gateway2/api/v1alpha1/zz_generated.deepcopy.go
@@ -9,6 +9,41 @@ import (
runtime "k8s.io/apimachinery/pkg/runtime"
)
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *AIExtensionTracing) DeepCopyInto(out *AIExtensionTracing) {
+ *out = *in
+ if in.Grpc != nil {
+ in, out := &in.Grpc, &out.Grpc
+ *out = new(AIExtensionTracingGrpc)
+ **out = **in
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AIExtensionTracing.
+func (in *AIExtensionTracing) DeepCopy() *AIExtensionTracing {
+ if in == nil {
+ return nil
+ }
+ out := new(AIExtensionTracing)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *AIExtensionTracingGrpc) DeepCopyInto(out *AIExtensionTracingGrpc) {
+ *out = *in
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AIExtensionTracingGrpc.
+func (in *AIExtensionTracingGrpc) DeepCopy() *AIExtensionTracingGrpc {
+ if in == nil {
+ return nil
+ }
+ out := new(AIExtensionTracingGrpc)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AiExtension) DeepCopyInto(out *AiExtension) {
*out = *in
@@ -59,6 +94,11 @@ func (in *AiExtension) DeepCopyInto(out *AiExtension) {
*out = new(AiExtensionStats)
(*in).DeepCopyInto(*out)
}
+ if in.Tracing != nil {
+ in, out := &in.Tracing, &out.Tracing
+ *out = new(AIExtensionTracing)
+ (*in).DeepCopyInto(*out)
+ }
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AiExtension.
diff --git a/projects/gateway2/deployer/merge.go b/projects/gateway2/deployer/merge.go
index 608c0b36e7b..a44bcefc9b9 100644
--- a/projects/gateway2/deployer/merge.go
+++ b/projects/gateway2/deployer/merge.go
@@ -720,6 +720,7 @@ func deepMergeAIExtension(dst, src *v1alpha1.AiExtension) *v1alpha1.AiExtension
dst.Env = deepMergeSlices(dst.GetEnv(), src.GetEnv())
dst.Ports = deepMergeSlices(dst.GetPorts(), src.GetPorts())
dst.Stats = deepMergeAIExtensionStats(dst.GetStats(), src.GetStats())
+ dst.Tracing = deepMergeAiExtensionTracing(dst.GetTracing(), src.GetTracing())
return dst
}
@@ -738,3 +739,35 @@ func deepMergeAIExtensionStats(dst, src *v1alpha1.AiExtensionStats) *v1alpha1.Ai
return dst
}
+
+func deepMergeAiExtensionTracing(dst, src *v1alpha1.AIExtensionTracing) *v1alpha1.AIExtensionTracing {
+ // nil src override means just use dst
+ if src == nil {
+ return dst
+ }
+
+ if dst == nil {
+ return src
+ }
+
+ dst.Grpc = deepMergeAiExtensionTracingGrpc(dst.GetGrpc(), src.GetGrpc())
+ dst.Insecure = mergeComparable(dst.GetInsecure(), src.GetInsecure())
+
+ return dst
+}
+
+func deepMergeAiExtensionTracingGrpc(dst, src *v1alpha1.AIExtensionTracingGrpc) *v1alpha1.AIExtensionTracingGrpc {
+ // nil src override means just use dst
+ if src == nil {
+ return dst
+ }
+
+ if dst == nil {
+ return src
+ }
+
+ dst.Host = mergeComparable(dst.GetHost(), src.GetHost())
+ dst.Port = mergeComparable(dst.GetPort(), src.GetPort())
+
+ return dst
+}
diff --git a/projects/gateway2/deployer/values.go b/projects/gateway2/deployer/values.go
index 4fc0f2a6621..8939e02a907 100644
--- a/projects/gateway2/deployer/values.go
+++ b/projects/gateway2/deployer/values.go
@@ -153,6 +153,7 @@ type helmAIExtension struct {
Env []*corev1.EnvVar `json:"env,omitempty"`
Ports []*corev1.ContainerPort `json:"ports,omitempty"`
Stats []byte `json:"stats,omitempty"`
+ Tracing []byte `json:"tracing,omitempty"`
}
type helmAws struct {
diff --git a/projects/gateway2/deployer/values_helpers.go b/projects/gateway2/deployer/values_helpers.go
index c27423f7ce2..043cc3b63d9 100644
--- a/projects/gateway2/deployer/values_helpers.go
+++ b/projects/gateway2/deployer/values_helpers.go
@@ -217,10 +217,18 @@ func getAIExtensionValues(config *v1alpha1.AiExtension) (*helmAIExtension, error
// If we don't do this check, a byte array containing the characters "null" will be rendered
// This will not be marshallable by the component so instead we render nothing.
- var byt []byte
+ var statsByt []byte
if config.GetStats() != nil {
var err error
- byt, err = json.Marshal(config.GetStats())
+ statsByt, err = json.Marshal(config.GetStats())
+ if err != nil {
+ return nil, err
+ }
+ }
+ var tracingByt []byte
+ if config.GetTracing() != nil {
+ var err error
+ tracingByt, err = json.Marshal(config.GetTracing())
if err != nil {
return nil, err
}
@@ -233,6 +241,7 @@ func getAIExtensionValues(config *v1alpha1.AiExtension) (*helmAIExtension, error
Resources: config.GetResources(),
Env: config.GetEnv(),
Ports: config.GetPorts(),
- Stats: byt,
+ Stats: statsByt,
+ Tracing: tracingByt,
}, nil
}
diff --git a/projects/gateway2/helm/gloo-gateway/templates/gateway/proxy-deployment.yaml b/projects/gateway2/helm/gloo-gateway/templates/gateway/proxy-deployment.yaml
index 54c55071971..cb0a0febb4c 100644
--- a/projects/gateway2/helm/gloo-gateway/templates/gateway/proxy-deployment.yaml
+++ b/projects/gateway2/helm/gloo-gateway/templates/gateway/proxy-deployment.yaml
@@ -401,10 +401,15 @@ metadata:
labels:
{{- include "gloo-gateway.gateway.constLabels" . | nindent 4 }}
{{- include "gloo-gateway.gateway.labels" . | nindent 4 }}
-{{- if $gateway.aiExtension.stats }}
+{{- if or $gateway.aiExtension.stats $gateway.aiExtension.tracing }}
data:
+{{- if $gateway.aiExtension.stats }}
stats.json: {{ $gateway.aiExtension.stats }}
{{- end}}
+{{- if $gateway.aiExtension.tracing }}
+ tracing.json: {{ $gateway.aiExtension.tracing }}
+{{- end}}
+{{- end}}
{{- end}}
---
apiVersion: v1
diff --git a/projects/gateway2/translator/listener/gateway_listener_translator.go b/projects/gateway2/translator/listener/gateway_listener_translator.go
index 2997f48dfc6..2c7a1620224 100644
--- a/projects/gateway2/translator/listener/gateway_listener_translator.go
+++ b/projects/gateway2/translator/listener/gateway_listener_translator.go
@@ -24,6 +24,7 @@ import (
"github.com/solo-io/gloo/projects/gateway2/translator/plugins/registry"
"github.com/solo-io/gloo/projects/gateway2/translator/routeutils"
"github.com/solo-io/gloo/projects/gateway2/translator/sslutils"
+ "github.com/solo-io/gloo/projects/gateway2/wellknown"
v1 "github.com/solo-io/gloo/projects/gloo/pkg/api/v1"
"github.com/solo-io/gloo/projects/gloo/pkg/api/v1/ssl"
"github.com/solo-io/gloo/projects/gloo/pkg/utils"
@@ -467,6 +468,20 @@ func (ml *MergedListener) TranslateListener(
TcpListeners: matchedTcpListeners,
},
},
+ // Used for tracing to create service_name
+ OpaqueMetadata: &v1.Listener_MetadataStatic{
+ MetadataStatic: &v1.SourceMetadata{
+ Sources: []*v1.SourceMetadata_SourceRef{
+ {
+ ResourceRef: &core.ResourceRef{
+ Name: ml.name,
+ Namespace: ml.gatewayNamespace,
+ },
+ ResourceKind: wellknown.GatewayGroup + "/" + wellknown.GatewayKind,
+ },
+ },
+ },
+ },
Options: nil, // Listener options will be added by policy plugins
RouteOptions: nil,
}
diff --git a/projects/gateway2/translator/testutils/outputs/backend-plugin-proxy.yaml b/projects/gateway2/translator/testutils/outputs/backend-plugin-proxy.yaml
index b367e7c1bcf..c4be72d1715 100644
--- a/projects/gateway2/translator/testutils/outputs/backend-plugin-proxy.yaml
+++ b/projects/gateway2/translator/testutils/outputs/backend-plugin-proxy.yaml
@@ -22,6 +22,12 @@ listeners:
name: test-backend-plugin-us
bindAddress: '::'
bindPort: 8080
+ metadataStatic:
+ sources:
+ - resourceKind: gateway.networking.k8s.io/Gateway
+ resourceRef:
+ name: http
+ namespace: default
name: http
metadata:
labels:
diff --git a/projects/gateway2/translator/testutils/outputs/delegation/basic.yaml b/projects/gateway2/translator/testutils/outputs/delegation/basic.yaml
index 136a6dafdd7..edcfd4c4428 100644
--- a/projects/gateway2/translator/testutils/outputs/delegation/basic.yaml
+++ b/projects/gateway2/translator/testutils/outputs/delegation/basic.yaml
@@ -36,6 +36,12 @@ listeners:
namespace: infra
bindAddress: '::'
bindPort: 8080
+ metadataStatic:
+ sources:
+ - resourceKind: gateway.networking.k8s.io/Gateway
+ resourceRef:
+ name: http
+ namespace: infra
name: http
metadata:
labels:
diff --git a/projects/gateway2/translator/testutils/outputs/delegation/basic_invalid_hostname.yaml b/projects/gateway2/translator/testutils/outputs/delegation/basic_invalid_hostname.yaml
index b3697abde47..285280856bf 100644
--- a/projects/gateway2/translator/testutils/outputs/delegation/basic_invalid_hostname.yaml
+++ b/projects/gateway2/translator/testutils/outputs/delegation/basic_invalid_hostname.yaml
@@ -25,6 +25,12 @@ listeners:
namespace: infra
bindAddress: '::'
bindPort: 8080
+ metadataStatic:
+ sources:
+ - resourceKind: gateway.networking.k8s.io/Gateway
+ resourceRef:
+ name: http
+ namespace: infra
name: http
metadata:
labels:
diff --git a/projects/gateway2/translator/testutils/outputs/delegation/basic_parentref_match.yaml b/projects/gateway2/translator/testutils/outputs/delegation/basic_parentref_match.yaml
index 136a6dafdd7..edcfd4c4428 100644
--- a/projects/gateway2/translator/testutils/outputs/delegation/basic_parentref_match.yaml
+++ b/projects/gateway2/translator/testutils/outputs/delegation/basic_parentref_match.yaml
@@ -36,6 +36,12 @@ listeners:
namespace: infra
bindAddress: '::'
bindPort: 8080
+ metadataStatic:
+ sources:
+ - resourceKind: gateway.networking.k8s.io/Gateway
+ resourceRef:
+ name: http
+ namespace: infra
name: http
metadata:
labels:
diff --git a/projects/gateway2/translator/testutils/outputs/delegation/basic_parentref_mismatch.yaml b/projects/gateway2/translator/testutils/outputs/delegation/basic_parentref_mismatch.yaml
index b3697abde47..285280856bf 100644
--- a/projects/gateway2/translator/testutils/outputs/delegation/basic_parentref_mismatch.yaml
+++ b/projects/gateway2/translator/testutils/outputs/delegation/basic_parentref_mismatch.yaml
@@ -25,6 +25,12 @@ listeners:
namespace: infra
bindAddress: '::'
bindPort: 8080
+ metadataStatic:
+ sources:
+ - resourceKind: gateway.networking.k8s.io/Gateway
+ resourceRef:
+ name: http
+ namespace: infra
name: http
metadata:
labels:
diff --git a/projects/gateway2/translator/testutils/outputs/delegation/bug-10379.yaml b/projects/gateway2/translator/testutils/outputs/delegation/bug-10379.yaml
index 8769e60937e..d6cb490fb9c 100644
--- a/projects/gateway2/translator/testutils/outputs/delegation/bug-10379.yaml
+++ b/projects/gateway2/translator/testutils/outputs/delegation/bug-10379.yaml
@@ -44,6 +44,12 @@ listeners:
namespace: default
bindAddress: '::'
bindPort: 8080
+ metadataStatic:
+ sources:
+ - resourceKind: gateway.networking.k8s.io/Gateway
+ resourceRef:
+ name: http
+ namespace: infra
name: http
metadata:
labels:
diff --git a/projects/gateway2/translator/testutils/outputs/delegation/bug-6621.yaml b/projects/gateway2/translator/testutils/outputs/delegation/bug-6621.yaml
index e63dbcf5196..988bf3c928d 100644
--- a/projects/gateway2/translator/testutils/outputs/delegation/bug-6621.yaml
+++ b/projects/gateway2/translator/testutils/outputs/delegation/bug-6621.yaml
@@ -25,6 +25,12 @@ listeners:
namespace: a
bindAddress: '::'
bindPort: 8080
+ metadataStatic:
+ sources:
+ - resourceKind: gateway.networking.k8s.io/Gateway
+ resourceRef:
+ name: http
+ namespace: infra
name: http
metadata:
labels:
diff --git a/projects/gateway2/translator/testutils/outputs/delegation/child_rule_matcher.yaml b/projects/gateway2/translator/testutils/outputs/delegation/child_rule_matcher.yaml
index 1a6b4cbbb6b..19f80a1930d 100644
--- a/projects/gateway2/translator/testutils/outputs/delegation/child_rule_matcher.yaml
+++ b/projects/gateway2/translator/testutils/outputs/delegation/child_rule_matcher.yaml
@@ -46,6 +46,12 @@ listeners:
namespace: infra
bindAddress: '::'
bindPort: 8080
+ metadataStatic:
+ sources:
+ - resourceKind: gateway.networking.k8s.io/Gateway
+ resourceRef:
+ name: http
+ namespace: infra
name: http
metadata:
labels:
diff --git a/projects/gateway2/translator/testutils/outputs/delegation/cyclic1.yaml b/projects/gateway2/translator/testutils/outputs/delegation/cyclic1.yaml
index 136a6dafdd7..edcfd4c4428 100644
--- a/projects/gateway2/translator/testutils/outputs/delegation/cyclic1.yaml
+++ b/projects/gateway2/translator/testutils/outputs/delegation/cyclic1.yaml
@@ -36,6 +36,12 @@ listeners:
namespace: infra
bindAddress: '::'
bindPort: 8080
+ metadataStatic:
+ sources:
+ - resourceKind: gateway.networking.k8s.io/Gateway
+ resourceRef:
+ name: http
+ namespace: infra
name: http
metadata:
labels:
diff --git a/projects/gateway2/translator/testutils/outputs/delegation/cyclic2.yaml b/projects/gateway2/translator/testutils/outputs/delegation/cyclic2.yaml
index 136a6dafdd7..edcfd4c4428 100644
--- a/projects/gateway2/translator/testutils/outputs/delegation/cyclic2.yaml
+++ b/projects/gateway2/translator/testutils/outputs/delegation/cyclic2.yaml
@@ -36,6 +36,12 @@ listeners:
namespace: infra
bindAddress: '::'
bindPort: 8080
+ metadataStatic:
+ sources:
+ - resourceKind: gateway.networking.k8s.io/Gateway
+ resourceRef:
+ name: http
+ namespace: infra
name: http
metadata:
labels:
diff --git a/projects/gateway2/translator/testutils/outputs/delegation/invalid_child_valid_standalone.yaml b/projects/gateway2/translator/testutils/outputs/delegation/invalid_child_valid_standalone.yaml
index 579c81cce6e..cfc09424bad 100644
--- a/projects/gateway2/translator/testutils/outputs/delegation/invalid_child_valid_standalone.yaml
+++ b/projects/gateway2/translator/testutils/outputs/delegation/invalid_child_valid_standalone.yaml
@@ -42,6 +42,12 @@ listeners:
namespace: a
bindAddress: '::'
bindPort: 8080
+ metadataStatic:
+ sources:
+ - resourceKind: gateway.networking.k8s.io/Gateway
+ resourceRef:
+ name: http
+ namespace: infra
name: http
metadata:
labels:
diff --git a/projects/gateway2/translator/testutils/outputs/delegation/multiple_children.yaml b/projects/gateway2/translator/testutils/outputs/delegation/multiple_children.yaml
index 24da4387a98..577d619de06 100644
--- a/projects/gateway2/translator/testutils/outputs/delegation/multiple_children.yaml
+++ b/projects/gateway2/translator/testutils/outputs/delegation/multiple_children.yaml
@@ -48,6 +48,12 @@ listeners:
bindAddress: '::'
bindPort: 8080
+ metadataStatic:
+ sources:
+ - resourceKind: gateway.networking.k8s.io/Gateway
+ resourceRef:
+ name: http
+ namespace: infra
name: http
metadata:
labels:
diff --git a/projects/gateway2/translator/testutils/outputs/delegation/multiple_parents.yaml b/projects/gateway2/translator/testutils/outputs/delegation/multiple_parents.yaml
index 49a4a2efd92..c344dca3372 100644
--- a/projects/gateway2/translator/testutils/outputs/delegation/multiple_parents.yaml
+++ b/projects/gateway2/translator/testutils/outputs/delegation/multiple_parents.yaml
@@ -64,6 +64,12 @@ listeners:
namespace: a
bindAddress: '::'
bindPort: 8080
+ metadataStatic:
+ sources:
+ - resourceKind: gateway.networking.k8s.io/Gateway
+ resourceRef:
+ name: http
+ namespace: infra
name: http
metadata:
labels:
diff --git a/projects/gateway2/translator/testutils/outputs/delegation/nested_absolute_relative.yaml b/projects/gateway2/translator/testutils/outputs/delegation/nested_absolute_relative.yaml
index c3b2be817f2..34dcee2852a 100644
--- a/projects/gateway2/translator/testutils/outputs/delegation/nested_absolute_relative.yaml
+++ b/projects/gateway2/translator/testutils/outputs/delegation/nested_absolute_relative.yaml
@@ -85,6 +85,12 @@ listeners:
namespace: a
bindAddress: '::'
bindPort: 8080
+ metadataStatic:
+ sources:
+ - resourceKind: gateway.networking.k8s.io/Gateway
+ resourceRef:
+ name: http
+ namespace: infra
name: http
metadata:
labels:
diff --git a/projects/gateway2/translator/testutils/outputs/delegation/recursive.yaml b/projects/gateway2/translator/testutils/outputs/delegation/recursive.yaml
index 36bd398c776..cbae4243100 100644
--- a/projects/gateway2/translator/testutils/outputs/delegation/recursive.yaml
+++ b/projects/gateway2/translator/testutils/outputs/delegation/recursive.yaml
@@ -47,6 +47,12 @@ listeners:
namespace: infra
bindAddress: '::'
bindPort: 8080
+ metadataStatic:
+ sources:
+ - resourceKind: gateway.networking.k8s.io/Gateway
+ resourceRef:
+ name: http
+ namespace: infra
name: http
metadata:
labels:
diff --git a/projects/gateway2/translator/testutils/outputs/delegation/relative_paths.yaml b/projects/gateway2/translator/testutils/outputs/delegation/relative_paths.yaml
index 4b339e4847a..5b61d0e71f8 100644
--- a/projects/gateway2/translator/testutils/outputs/delegation/relative_paths.yaml
+++ b/projects/gateway2/translator/testutils/outputs/delegation/relative_paths.yaml
@@ -163,6 +163,12 @@ listeners:
namespace: a
bindAddress: '::'
bindPort: 8080
+ metadataStatic:
+ sources:
+ - resourceKind: gateway.networking.k8s.io/Gateway
+ resourceRef:
+ name: http
+ namespace: infra
name: http
metadata:
labels:
diff --git a/projects/gateway2/translator/testutils/outputs/delegation/route_options.yaml b/projects/gateway2/translator/testutils/outputs/delegation/route_options.yaml
index d7cc71cf012..d1eabf27948 100644
--- a/projects/gateway2/translator/testutils/outputs/delegation/route_options.yaml
+++ b/projects/gateway2/translator/testutils/outputs/delegation/route_options.yaml
@@ -46,6 +46,12 @@ listeners:
namespace: infra
bindAddress: '::'
bindPort: 8080
+ metadataStatic:
+ sources:
+ - resourceKind: gateway.networking.k8s.io/Gateway
+ resourceRef:
+ name: http
+ namespace: infra
name: http
metadata:
labels:
diff --git a/projects/gateway2/translator/testutils/outputs/delegation/route_options_filter_override_merge.yaml b/projects/gateway2/translator/testutils/outputs/delegation/route_options_filter_override_merge.yaml
index 718c5234901..a5ee93f7ea8 100644
--- a/projects/gateway2/translator/testutils/outputs/delegation/route_options_filter_override_merge.yaml
+++ b/projects/gateway2/translator/testutils/outputs/delegation/route_options_filter_override_merge.yaml
@@ -72,6 +72,12 @@ listeners:
namespace: infra
bindAddress: '::'
bindPort: 8080
+ metadataStatic:
+ sources:
+ - resourceKind: gateway.networking.k8s.io/Gateway
+ resourceRef:
+ name: http
+ namespace: infra
name: http
metadata:
labels:
diff --git a/projects/gateway2/translator/testutils/outputs/delegation/route_options_inheritance.yaml b/projects/gateway2/translator/testutils/outputs/delegation/route_options_inheritance.yaml
index c31583de4a0..4fad350264c 100644
--- a/projects/gateway2/translator/testutils/outputs/delegation/route_options_inheritance.yaml
+++ b/projects/gateway2/translator/testutils/outputs/delegation/route_options_inheritance.yaml
@@ -56,6 +56,12 @@ listeners:
namespace: infra
bindAddress: '::'
bindPort: 8080
+ metadataStatic:
+ sources:
+ - resourceKind: gateway.networking.k8s.io/Gateway
+ resourceRef:
+ name: http
+ namespace: infra
name: http
metadata:
labels:
diff --git a/projects/gateway2/translator/testutils/outputs/delegation/route_options_inheritance_child_override_ignore.yaml b/projects/gateway2/translator/testutils/outputs/delegation/route_options_inheritance_child_override_ignore.yaml
index c31583de4a0..4fad350264c 100644
--- a/projects/gateway2/translator/testutils/outputs/delegation/route_options_inheritance_child_override_ignore.yaml
+++ b/projects/gateway2/translator/testutils/outputs/delegation/route_options_inheritance_child_override_ignore.yaml
@@ -56,6 +56,12 @@ listeners:
namespace: infra
bindAddress: '::'
bindPort: 8080
+ metadataStatic:
+ sources:
+ - resourceKind: gateway.networking.k8s.io/Gateway
+ resourceRef:
+ name: http
+ namespace: infra
name: http
metadata:
labels:
diff --git a/projects/gateway2/translator/testutils/outputs/delegation/route_options_inheritance_child_override_ok.yaml b/projects/gateway2/translator/testutils/outputs/delegation/route_options_inheritance_child_override_ok.yaml
index d65fef6d9dc..4c7e30da7a9 100644
--- a/projects/gateway2/translator/testutils/outputs/delegation/route_options_inheritance_child_override_ok.yaml
+++ b/projects/gateway2/translator/testutils/outputs/delegation/route_options_inheritance_child_override_ok.yaml
@@ -68,6 +68,12 @@ listeners:
namespace: infra
bindAddress: '::'
bindPort: 8080
+ metadataStatic:
+ sources:
+ - resourceKind: gateway.networking.k8s.io/Gateway
+ resourceRef:
+ name: http
+ namespace: infra
name: http
metadata:
labels:
diff --git a/projects/gateway2/translator/testutils/outputs/delegation/route_options_multi_level_inheritance_override_ok.yaml b/projects/gateway2/translator/testutils/outputs/delegation/route_options_multi_level_inheritance_override_ok.yaml
index b931a5b0aca..ff112446ad4 100644
--- a/projects/gateway2/translator/testutils/outputs/delegation/route_options_multi_level_inheritance_override_ok.yaml
+++ b/projects/gateway2/translator/testutils/outputs/delegation/route_options_multi_level_inheritance_override_ok.yaml
@@ -72,6 +72,12 @@ listeners:
namespace: infra
bindAddress: '::'
bindPort: 8080
+ metadataStatic:
+ sources:
+ - resourceKind: gateway.networking.k8s.io/Gateway
+ resourceRef:
+ name: http
+ namespace: infra
name: http
metadata:
labels:
diff --git a/projects/gateway2/translator/testutils/outputs/http-routing-invalid-backend.yaml b/projects/gateway2/translator/testutils/outputs/http-routing-invalid-backend.yaml
index e50c620a17a..eaafe3f15d3 100644
--- a/projects/gateway2/translator/testutils/outputs/http-routing-invalid-backend.yaml
+++ b/projects/gateway2/translator/testutils/outputs/http-routing-invalid-backend.yaml
@@ -20,6 +20,12 @@ listeners:
name: httproute-example-route-default-0-0
bindAddress: '::'
bindPort: 8080
+ metadataStatic:
+ sources:
+ - resourceKind: gateway.networking.k8s.io/Gateway
+ resourceRef:
+ name: http
+ namespace: default
name: http
metadata:
labels:
diff --git a/projects/gateway2/translator/testutils/outputs/http-routing-missing-backend.yaml b/projects/gateway2/translator/testutils/outputs/http-routing-missing-backend.yaml
index 56b323bd596..bfadde0e786 100644
--- a/projects/gateway2/translator/testutils/outputs/http-routing-missing-backend.yaml
+++ b/projects/gateway2/translator/testutils/outputs/http-routing-missing-backend.yaml
@@ -25,6 +25,12 @@ listeners:
namespace: blackhole_ns
bindAddress: '::'
bindPort: 8080
+ metadataStatic:
+ sources:
+ - resourceKind: gateway.networking.k8s.io/Gateway
+ resourceRef:
+ name: http
+ namespace: default
name: http
metadata:
labels:
diff --git a/projects/gateway2/translator/testutils/outputs/http-routing-proxy.yaml b/projects/gateway2/translator/testutils/outputs/http-routing-proxy.yaml
index 4ec64c5b4f8..7dc2e1e0ab0 100644
--- a/projects/gateway2/translator/testutils/outputs/http-routing-proxy.yaml
+++ b/projects/gateway2/translator/testutils/outputs/http-routing-proxy.yaml
@@ -73,6 +73,12 @@ listeners:
namespace: default
bindAddress: '::'
bindPort: 8080
+ metadataStatic:
+ sources:
+ - resourceKind: gateway.networking.k8s.io/Gateway
+ resourceRef:
+ name: http
+ namespace: default
name: http
metadata:
labels:
diff --git a/projects/gateway2/translator/testutils/outputs/http-with-azure-destination-proxy.yaml b/projects/gateway2/translator/testutils/outputs/http-with-azure-destination-proxy.yaml
index 07350d8b941..9b661f06c35 100644
--- a/projects/gateway2/translator/testutils/outputs/http-with-azure-destination-proxy.yaml
+++ b/projects/gateway2/translator/testutils/outputs/http-with-azure-destination-proxy.yaml
@@ -25,6 +25,12 @@ listeners:
namespace: default
bindAddress: '::'
bindPort: 8080
+ metadataStatic:
+ sources:
+ - resourceKind: gateway.networking.k8s.io/Gateway
+ resourceRef:
+ name: http
+ namespace: default
name: http
metadata:
labels:
diff --git a/projects/gateway2/translator/testutils/outputs/http-with-header-modifier-proxy.yaml b/projects/gateway2/translator/testutils/outputs/http-with-header-modifier-proxy.yaml
index 82ee54d1c60..e04fcdcd1bd 100644
--- a/projects/gateway2/translator/testutils/outputs/http-with-header-modifier-proxy.yaml
+++ b/projects/gateway2/translator/testutils/outputs/http-with-header-modifier-proxy.yaml
@@ -60,6 +60,12 @@ listeners:
namespace: default
bindAddress: '::'
bindPort: 8080
+ metadataStatic:
+ sources:
+ - resourceKind: gateway.networking.k8s.io/Gateway
+ resourceRef:
+ name: http
+ namespace: default
name: http
metadata:
labels:
diff --git a/projects/gateway2/translator/testutils/outputs/http-with-lambda-destination-proxy.yaml b/projects/gateway2/translator/testutils/outputs/http-with-lambda-destination-proxy.yaml
index 8fc1b63f47a..c5c99e4ff1b 100644
--- a/projects/gateway2/translator/testutils/outputs/http-with-lambda-destination-proxy.yaml
+++ b/projects/gateway2/translator/testutils/outputs/http-with-lambda-destination-proxy.yaml
@@ -25,6 +25,12 @@ listeners:
namespace: default
bindAddress: '::'
bindPort: 8080
+ metadataStatic:
+ sources:
+ - resourceKind: gateway.networking.k8s.io/Gateway
+ resourceRef:
+ name: http
+ namespace: default
name: http
metadata:
labels:
diff --git a/projects/gateway2/translator/testutils/outputs/https-routing-proxy.yaml b/projects/gateway2/translator/testutils/outputs/https-routing-proxy.yaml
index 76641cb6e0c..170b99c7f89 100644
--- a/projects/gateway2/translator/testutils/outputs/https-routing-proxy.yaml
+++ b/projects/gateway2/translator/testutils/outputs/https-routing-proxy.yaml
@@ -29,6 +29,12 @@ listeners:
namespace: default
bindAddress: '::'
bindPort: 8443
+ metadataStatic:
+ sources:
+ - resourceKind: gateway.networking.k8s.io/Gateway
+ resourceRef:
+ name: https
+ namespace: default
name: https
metadata:
labels:
diff --git a/projects/gateway2/translator/testutils/outputs/multiple-listeners-http-routing-proxy.yaml b/projects/gateway2/translator/testutils/outputs/multiple-listeners-http-routing-proxy.yaml
index 39a9ecfbf7a..a938f04e754 100644
--- a/projects/gateway2/translator/testutils/outputs/multiple-listeners-http-routing-proxy.yaml
+++ b/projects/gateway2/translator/testutils/outputs/multiple-listeners-http-routing-proxy.yaml
@@ -6,6 +6,12 @@ listeners:
httpResources: {}
bindAddress: '::'
bindPort: 8080
+ metadataStatic:
+ sources:
+ - resourceKind: gateway.networking.k8s.io/Gateway
+ resourceRef:
+ name: http-httpbin~http-bookinfo
+ namespace: default
name: http-httpbin~http-bookinfo
metadata:
labels:
diff --git a/projects/gateway2/translator/testutils/outputs/multiple-listeners-https-routing-proxy.yaml b/projects/gateway2/translator/testutils/outputs/multiple-listeners-https-routing-proxy.yaml
index e1115ad5ce0..0b92e2f1305 100644
--- a/projects/gateway2/translator/testutils/outputs/multiple-listeners-https-routing-proxy.yaml
+++ b/projects/gateway2/translator/testutils/outputs/multiple-listeners-https-routing-proxy.yaml
@@ -4,6 +4,12 @@ listeners:
httpResources: {}
bindAddress: '::'
bindPort: 8443
+ metadataStatic:
+ sources:
+ - resourceKind: gateway.networking.k8s.io/Gateway
+ resourceRef:
+ name: https-httpbin~https-bookinfo
+ namespace: default
name: https-httpbin~https-bookinfo
metadata:
labels:
diff --git a/projects/gateway2/translator/testutils/outputs/no_route.yaml b/projects/gateway2/translator/testutils/outputs/no_route.yaml
index 3b12e4cd4ef..e1e7b672584 100644
--- a/projects/gateway2/translator/testutils/outputs/no_route.yaml
+++ b/projects/gateway2/translator/testutils/outputs/no_route.yaml
@@ -11,4 +11,10 @@ listeners:
httpResources: {}
bindAddress: '::'
bindPort: 8080
+ metadataStatic:
+ sources:
+ - resourceKind: gateway.networking.k8s.io/Gateway
+ resourceRef:
+ name: http
+ namespace: default
name: http
\ No newline at end of file
diff --git a/projects/gateway2/translator/testutils/outputs/route-sort.yaml b/projects/gateway2/translator/testutils/outputs/route-sort.yaml
index 95372a8ebcc..abf0f3ab811 100644
--- a/projects/gateway2/translator/testutils/outputs/route-sort.yaml
+++ b/projects/gateway2/translator/testutils/outputs/route-sort.yaml
@@ -146,6 +146,12 @@ listeners:
namespace: infra
bindAddress: '::'
bindPort: 8080
+ metadataStatic:
+ sources:
+ - resourceKind: gateway.networking.k8s.io/Gateway
+ resourceRef:
+ name: http
+ namespace: infra
name: http
metadata:
labels:
diff --git a/projects/gateway2/translator/testutils/outputs/route_options/merge.yaml b/projects/gateway2/translator/testutils/outputs/route_options/merge.yaml
index 64305b75faa..9a1766e47c9 100644
--- a/projects/gateway2/translator/testutils/outputs/route_options/merge.yaml
+++ b/projects/gateway2/translator/testutils/outputs/route_options/merge.yaml
@@ -51,6 +51,12 @@ listeners:
namespace: default
bindAddress: '::'
bindPort: 8080
+ metadataStatic:
+ sources:
+ - resourceKind: gateway.networking.k8s.io/Gateway
+ resourceRef:
+ name: http
+ namespace: default
name: http
metadata:
labels:
diff --git a/projects/gateway2/translator/testutils/outputs/tcp-routing/basic-proxy.yaml b/projects/gateway2/translator/testutils/outputs/tcp-routing/basic-proxy.yaml
index 9729764385c..1a8563e7284 100644
--- a/projects/gateway2/translator/testutils/outputs/tcp-routing/basic-proxy.yaml
+++ b/projects/gateway2/translator/testutils/outputs/tcp-routing/basic-proxy.yaml
@@ -3,6 +3,12 @@ listeners:
- name: tcp
bindAddress: "::"
bindPort: 8080
+ metadataStatic:
+ sources:
+ - resourceKind: gateway.networking.k8s.io/Gateway
+ resourceRef:
+ name: tcp
+ namespace: default
aggregateListener:
httpResources: {}
tcpListeners:
diff --git a/projects/gateway2/translator/testutils/outputs/tcp-routing/invalid-backend.yaml b/projects/gateway2/translator/testutils/outputs/tcp-routing/invalid-backend.yaml
index 704f42cf1af..2da2daf48bf 100644
--- a/projects/gateway2/translator/testutils/outputs/tcp-routing/invalid-backend.yaml
+++ b/projects/gateway2/translator/testutils/outputs/tcp-routing/invalid-backend.yaml
@@ -4,6 +4,12 @@ listeners:
- name: tcp
bindAddress: "::"
bindPort: 8080
+ metadataStatic:
+ sources:
+ - resourceKind: gateway.networking.k8s.io/Gateway
+ resourceRef:
+ name: tcp
+ namespace: default
aggregateListener:
httpResources: {}
metadata:
diff --git a/projects/gateway2/translator/testutils/outputs/tcp-routing/missing-backend.yaml b/projects/gateway2/translator/testutils/outputs/tcp-routing/missing-backend.yaml
index 7c6b7b2e338..1eaaeff439d 100644
--- a/projects/gateway2/translator/testutils/outputs/tcp-routing/missing-backend.yaml
+++ b/projects/gateway2/translator/testutils/outputs/tcp-routing/missing-backend.yaml
@@ -5,6 +5,12 @@ listeners:
httpResources: {}
bindAddress: '::'
bindPort: 8080
+ metadataStatic:
+ sources:
+ - resourceKind: gateway.networking.k8s.io/Gateway
+ resourceRef:
+ name: tcp
+ namespace: default
name: tcp
metadata:
labels:
diff --git a/projects/gateway2/translator/testutils/outputs/tcp-routing/multi-backend-proxy.yaml b/projects/gateway2/translator/testutils/outputs/tcp-routing/multi-backend-proxy.yaml
index 9c3f2a2b823..64e06689315 100644
--- a/projects/gateway2/translator/testutils/outputs/tcp-routing/multi-backend-proxy.yaml
+++ b/projects/gateway2/translator/testutils/outputs/tcp-routing/multi-backend-proxy.yaml
@@ -3,6 +3,12 @@ listeners:
- name: tcp
bindAddress: "::"
bindPort: 8080
+ metadataStatic:
+ sources:
+ - resourceKind: gateway.networking.k8s.io/Gateway
+ resourceRef:
+ name: tcp
+ namespace: default
aggregateListener:
httpResources: {}
tcpListeners:
diff --git a/projects/gloo/api/external/envoy/config/trace/v3/opentelemetry.proto b/projects/gloo/api/external/envoy/config/trace/v3/opentelemetry.proto
index 507c1724a5c..63ba1048ef2 100644
--- a/projects/gloo/api/external/envoy/config/trace/v3/opentelemetry.proto
+++ b/projects/gloo/api/external/envoy/config/trace/v3/opentelemetry.proto
@@ -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/gloo/projects/gloo/pkg/api/external/envoy/config/trace/v3";
diff --git a/projects/gloo/api/v1/options/tracing/tracing.proto b/projects/gloo/api/v1/options/tracing/tracing.proto
index 52abb430e91..2d08e3b6c35 100644
--- a/projects/gloo/api/v1/options/tracing/tracing.proto
+++ b/projects/gloo/api/v1/options/tracing/tracing.proto
@@ -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.
@@ -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;
+}
diff --git a/projects/gloo/pkg/api/external/envoy/config/trace/v3/opentelemetry.pb.clone.go b/projects/gloo/pkg/api/external/envoy/config/trace/v3/opentelemetry.pb.clone.go
index 489bca1d719..c75c4613aa4 100644
--- a/projects/gloo/pkg/api/external/envoy/config/trace/v3/opentelemetry.pb.clone.go
+++ b/projects/gloo/pkg/api/external/envoy/config/trace/v3/opentelemetry.pb.clone.go
@@ -35,6 +35,8 @@ func (m *OpenTelemetryConfig) Clone() proto.Message {
}
target = &OpenTelemetryConfig{}
+ target.ServiceName = m.GetServiceName()
+
switch m.CollectorCluster.(type) {
case *OpenTelemetryConfig_CollectorUpstreamRef:
diff --git a/projects/gloo/pkg/api/external/envoy/config/trace/v3/opentelemetry.pb.equal.go b/projects/gloo/pkg/api/external/envoy/config/trace/v3/opentelemetry.pb.equal.go
index 52e78696de7..990d43235f8 100644
--- a/projects/gloo/pkg/api/external/envoy/config/trace/v3/opentelemetry.pb.equal.go
+++ b/projects/gloo/pkg/api/external/envoy/config/trace/v3/opentelemetry.pb.equal.go
@@ -46,6 +46,10 @@ func (m *OpenTelemetryConfig) Equal(that interface{}) bool {
return false
}
+ if strings.Compare(m.GetServiceName(), target.GetServiceName()) != 0 {
+ return false
+ }
+
switch m.CollectorCluster.(type) {
case *OpenTelemetryConfig_CollectorUpstreamRef:
diff --git a/projects/gloo/pkg/api/external/envoy/config/trace/v3/opentelemetry.pb.go b/projects/gloo/pkg/api/external/envoy/config/trace/v3/opentelemetry.pb.go
index 117b01f0aad..0ce479a31b5 100644
--- a/projects/gloo/pkg/api/external/envoy/config/trace/v3/opentelemetry.pb.go
+++ b/projects/gloo/pkg/api/external/envoy/config/trace/v3/opentelemetry.pb.go
@@ -39,6 +39,10 @@ type OpenTelemetryConfig struct {
// *OpenTelemetryConfig_CollectorUpstreamRef
// *OpenTelemetryConfig_ClusterName
CollectorCluster isOpenTelemetryConfig_CollectorCluster `protobuf_oneof:"collector_cluster"`
+ // 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
+ ServiceName string `protobuf:"bytes,3,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"`
}
func (x *OpenTelemetryConfig) Reset() {
@@ -92,6 +96,13 @@ func (x *OpenTelemetryConfig) GetClusterName() string {
return ""
}
+func (x *OpenTelemetryConfig) GetServiceName() string {
+ if x != nil {
+ return x.ServiceName
+ }
+ return ""
+}
+
type isOpenTelemetryConfig_CollectorCluster interface {
isOpenTelemetryConfig_CollectorCluster()
}
@@ -133,7 +144,7 @@ var file_github_com_solo_io_gloo_projects_gloo_api_external_envoy_config_trace_v
0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x6f, 0x6c, 0x6f, 0x2d, 0x69, 0x6f, 0x2f, 0x73, 0x6f, 0x6c,
0x6f, 0x2d, 0x6b, 0x69, 0x74, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x66,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x12, 0x65, 0x78, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f,
- 0x2f, 0x65, 0x78, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd5, 0x01, 0x0a, 0x13, 0x4f,
+ 0x2f, 0x65, 0x78, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf8, 0x01, 0x0a, 0x13, 0x4f,
0x70, 0x65, 0x6e, 0x54, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x66,
0x69, 0x67, 0x12, 0x51, 0x0a, 0x16, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x5f,
0x75, 0x70, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x5f, 0x72, 0x65, 0x66, 0x18, 0x01, 0x20, 0x01,
@@ -142,26 +153,28 @@ var file_github_com_solo_io_gloo_projects_gloo_api_external_envoy_config_trace_v
0x14, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x55, 0x70, 0x73, 0x74, 0x72, 0x65,
0x61, 0x6d, 0x52, 0x65, 0x66, 0x12, 0x23, 0x0a, 0x0c, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72,
0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0b, 0x63,
- 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x3a, 0x31, 0x8a, 0xc8, 0xde, 0x8e,
- 0x04, 0x2b, 0x0a, 0x29, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67,
- 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x54, 0x65,
- 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x13, 0x0a,
- 0x11, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74,
- 0x65, 0x72, 0x42, 0xdb, 0x01, 0xb8, 0xf5, 0x04, 0x01, 0xc0, 0xf5, 0x04, 0x01, 0xd0, 0xf5, 0x04,
- 0x01, 0x82, 0x8a, 0xd7, 0xad, 0x04, 0x30, 0x12, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x65,
- 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x72,
- 0x73, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e,
- 0x76, 0x34, 0x61, 0x6c, 0x70, 0x68, 0x61, 0xe2, 0xb5, 0xdf, 0xcb, 0x07, 0x02, 0x10, 0x02, 0x0a,
- 0x2b, 0x69, 0x6f, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x73,
- 0x6f, 0x6c, 0x6f, 0x2e, 0x69, 0x6f, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x63, 0x6f, 0x6e,
- 0x66, 0x69, 0x67, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x33, 0x42, 0x12, 0x4f, 0x70,
- 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f,
- 0x50, 0x01, 0x5a, 0x4c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73,
- 0x6f, 0x6c, 0x6f, 0x2d, 0x69, 0x6f, 0x2f, 0x67, 0x6c, 0x6f, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x6a,
- 0x65, 0x63, 0x74, 0x73, 0x2f, 0x67, 0x6c, 0x6f, 0x6f, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70,
- 0x69, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79,
- 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2f, 0x76, 0x33,
- 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+ 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x65,
+ 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09,
+ 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x3a, 0x31, 0x8a,
+ 0xc8, 0xde, 0x8e, 0x04, 0x2b, 0x0a, 0x29, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x63, 0x6f, 0x6e,
+ 0x66, 0x69, 0x67, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x70, 0x65,
+ 0x6e, 0x54, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67,
+ 0x42, 0x13, 0x0a, 0x11, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x5f, 0x63, 0x6c,
+ 0x75, 0x73, 0x74, 0x65, 0x72, 0x42, 0xdb, 0x01, 0xb8, 0xf5, 0x04, 0x01, 0xc0, 0xf5, 0x04, 0x01,
+ 0xd0, 0xf5, 0x04, 0x01, 0x82, 0x8a, 0xd7, 0xad, 0x04, 0x30, 0x12, 0x2e, 0x65, 0x6e, 0x76, 0x6f,
+ 0x79, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x72, 0x61,
+ 0x63, 0x65, 0x72, 0x73, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74,
+ 0x72, 0x79, 0x2e, 0x76, 0x34, 0x61, 0x6c, 0x70, 0x68, 0x61, 0xe2, 0xb5, 0xdf, 0xcb, 0x07, 0x02,
+ 0x10, 0x02, 0x0a, 0x2b, 0x69, 0x6f, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, 0x78,
+ 0x79, 0x2e, 0x73, 0x6f, 0x6c, 0x6f, 0x2e, 0x69, 0x6f, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e,
+ 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x33, 0x42,
+ 0x12, 0x4f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x50, 0x72,
+ 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x4c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f,
+ 0x6d, 0x2f, 0x73, 0x6f, 0x6c, 0x6f, 0x2d, 0x69, 0x6f, 0x2f, 0x67, 0x6c, 0x6f, 0x6f, 0x2f, 0x70,
+ 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x67, 0x6c, 0x6f, 0x6f, 0x2f, 0x70, 0x6b, 0x67,
+ 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x65, 0x6e,
+ 0x76, 0x6f, 0x79, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x74, 0x72, 0x61, 0x63, 0x65,
+ 0x2f, 0x76, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
diff --git a/projects/gloo/pkg/api/external/envoy/config/trace/v3/opentelemetry.pb.hash.go b/projects/gloo/pkg/api/external/envoy/config/trace/v3/opentelemetry.pb.hash.go
index 7fd5698d49a..75f8e15e226 100644
--- a/projects/gloo/pkg/api/external/envoy/config/trace/v3/opentelemetry.pb.hash.go
+++ b/projects/gloo/pkg/api/external/envoy/config/trace/v3/opentelemetry.pb.hash.go
@@ -42,6 +42,10 @@ func (m *OpenTelemetryConfig) Hash(hasher hash.Hash64) (uint64, error) {
return 0, err
}
+ if _, err = hasher.Write([]byte(m.GetServiceName())); err != nil {
+ return 0, err
+ }
+
switch m.CollectorCluster.(type) {
case *OpenTelemetryConfig_CollectorUpstreamRef:
diff --git a/projects/gloo/pkg/api/external/envoy/config/trace/v3/opentelemetry.pb.uniquehash.go b/projects/gloo/pkg/api/external/envoy/config/trace/v3/opentelemetry.pb.uniquehash.go
index e8670cf7461..591efdfee17 100644
--- a/projects/gloo/pkg/api/external/envoy/config/trace/v3/opentelemetry.pb.uniquehash.go
+++ b/projects/gloo/pkg/api/external/envoy/config/trace/v3/opentelemetry.pb.uniquehash.go
@@ -43,6 +43,13 @@ func (m *OpenTelemetryConfig) HashUnique(hasher hash.Hash64) (uint64, error) {
return 0, err
}
+ if _, err = hasher.Write([]byte("ServiceName")); err != nil {
+ return 0, err
+ }
+ if _, err = hasher.Write([]byte(m.GetServiceName())); err != nil {
+ return 0, err
+ }
+
switch m.CollectorCluster.(type) {
case *OpenTelemetryConfig_CollectorUpstreamRef:
diff --git a/projects/gloo/pkg/api/v1/options/tracing/tracing.pb.clone.go b/projects/gloo/pkg/api/v1/options/tracing/tracing.pb.clone.go
index 40109089b50..0f134e045b0 100644
--- a/projects/gloo/pkg/api/v1/options/tracing/tracing.pb.clone.go
+++ b/projects/gloo/pkg/api/v1/options/tracing/tracing.pb.clone.go
@@ -88,6 +88,21 @@ func (m *ListenerTracingSettings) Clone() proto.Message {
}
}
+ if m.GetMetadataForTags() != nil {
+ target.MetadataForTags = make([]*TracingTagMetadata, len(m.GetMetadataForTags()))
+ for idx, v := range m.GetMetadataForTags() {
+
+ if h, ok := interface{}(v).(clone.Cloner); ok {
+ target.MetadataForTags[idx] = h.Clone().(*TracingTagMetadata)
+ } else {
+ target.MetadataForTags[idx] = proto.Clone(v).(*TracingTagMetadata)
+ }
+
+ }
+ }
+
+ target.SpawnUpstreamSpan = m.GetSpawnUpstreamSpan()
+
switch m.ProviderConfig.(type) {
case *ListenerTracingSettings_ZipkinConfig:
@@ -248,3 +263,43 @@ func (m *TracingTagLiteral) Clone() proto.Message {
return target
}
+
+// Clone function
+func (m *TracingTagMetadata) Clone() proto.Message {
+ var target *TracingTagMetadata
+ if m == nil {
+ return target
+ }
+ target = &TracingTagMetadata{}
+
+ target.Tag = m.GetTag()
+
+ target.Kind = m.GetKind()
+
+ if h, ok := interface{}(m.GetValue()).(clone.Cloner); ok {
+ target.Value = h.Clone().(*TracingTagMetadata_MetadataValue)
+ } else {
+ target.Value = proto.Clone(m.GetValue()).(*TracingTagMetadata_MetadataValue)
+ }
+
+ target.DefaultValue = m.GetDefaultValue()
+
+ return target
+}
+
+// Clone function
+func (m *TracingTagMetadata_MetadataValue) Clone() proto.Message {
+ var target *TracingTagMetadata_MetadataValue
+ if m == nil {
+ return target
+ }
+ target = &TracingTagMetadata_MetadataValue{}
+
+ target.Namespace = m.GetNamespace()
+
+ target.Key = m.GetKey()
+
+ target.NestedFieldDelimiter = m.GetNestedFieldDelimiter()
+
+ return target
+}
diff --git a/projects/gloo/pkg/api/v1/options/tracing/tracing.pb.equal.go b/projects/gloo/pkg/api/v1/options/tracing/tracing.pb.equal.go
index bab1f7a12f7..03cadd4b39c 100644
--- a/projects/gloo/pkg/api/v1/options/tracing/tracing.pb.equal.go
+++ b/projects/gloo/pkg/api/v1/options/tracing/tracing.pb.equal.go
@@ -117,6 +117,27 @@ func (m *ListenerTracingSettings) Equal(that interface{}) bool {
}
+ if len(m.GetMetadataForTags()) != len(target.GetMetadataForTags()) {
+ return false
+ }
+ for idx, v := range m.GetMetadataForTags() {
+
+ if h, ok := interface{}(v).(equality.Equalizer); ok {
+ if !h.Equal(target.GetMetadataForTags()[idx]) {
+ return false
+ }
+ } else {
+ if !proto.Equal(v, target.GetMetadataForTags()[idx]) {
+ return false
+ }
+ }
+
+ }
+
+ if m.GetSpawnUpstreamSpan() != target.GetSpawnUpstreamSpan() {
+ return false
+ }
+
switch m.ProviderConfig.(type) {
case *ListenerTracingSettings_ZipkinConfig:
@@ -388,3 +409,85 @@ func (m *TracingTagLiteral) Equal(that interface{}) bool {
return true
}
+
+// Equal function
+func (m *TracingTagMetadata) Equal(that interface{}) bool {
+ if that == nil {
+ return m == nil
+ }
+
+ target, ok := that.(*TracingTagMetadata)
+ if !ok {
+ that2, ok := that.(TracingTagMetadata)
+ if ok {
+ target = &that2
+ } else {
+ return false
+ }
+ }
+ if target == nil {
+ return m == nil
+ } else if m == nil {
+ return false
+ }
+
+ if strings.Compare(m.GetTag(), target.GetTag()) != 0 {
+ return false
+ }
+
+ if m.GetKind() != target.GetKind() {
+ return false
+ }
+
+ if h, ok := interface{}(m.GetValue()).(equality.Equalizer); ok {
+ if !h.Equal(target.GetValue()) {
+ return false
+ }
+ } else {
+ if !proto.Equal(m.GetValue(), target.GetValue()) {
+ return false
+ }
+ }
+
+ if strings.Compare(m.GetDefaultValue(), target.GetDefaultValue()) != 0 {
+ return false
+ }
+
+ return true
+}
+
+// Equal function
+func (m *TracingTagMetadata_MetadataValue) Equal(that interface{}) bool {
+ if that == nil {
+ return m == nil
+ }
+
+ target, ok := that.(*TracingTagMetadata_MetadataValue)
+ if !ok {
+ that2, ok := that.(TracingTagMetadata_MetadataValue)
+ if ok {
+ target = &that2
+ } else {
+ return false
+ }
+ }
+ if target == nil {
+ return m == nil
+ } else if m == nil {
+ return false
+ }
+
+ if strings.Compare(m.GetNamespace(), target.GetNamespace()) != 0 {
+ return false
+ }
+
+ if strings.Compare(m.GetKey(), target.GetKey()) != 0 {
+ return false
+ }
+
+ if strings.Compare(m.GetNestedFieldDelimiter(), target.GetNestedFieldDelimiter()) != 0 {
+ return false
+ }
+
+ return true
+}
diff --git a/projects/gloo/pkg/api/v1/options/tracing/tracing.pb.go b/projects/gloo/pkg/api/v1/options/tracing/tracing.pb.go
index 223fdf52a3e..94ffcbd09fb 100644
--- a/projects/gloo/pkg/api/v1/options/tracing/tracing.pb.go
+++ b/projects/gloo/pkg/api/v1/options/tracing/tracing.pb.go
@@ -26,6 +26,54 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
+type TracingTagMetadata_Kind int32
+
+const (
+ // The metadata is extracted from the stream metadata.
+ TracingTagMetadata_REQUEST TracingTagMetadata_Kind = 0
+ // The metadata is extracted from the endpoint metadata.
+ TracingTagMetadata_ENDPOINT TracingTagMetadata_Kind = 1
+)
+
+// Enum value maps for TracingTagMetadata_Kind.
+var (
+ TracingTagMetadata_Kind_name = map[int32]string{
+ 0: "REQUEST",
+ 1: "ENDPOINT",
+ }
+ TracingTagMetadata_Kind_value = map[string]int32{
+ "REQUEST": 0,
+ "ENDPOINT": 1,
+ }
+)
+
+func (x TracingTagMetadata_Kind) Enum() *TracingTagMetadata_Kind {
+ p := new(TracingTagMetadata_Kind)
+ *p = x
+ return p
+}
+
+func (x TracingTagMetadata_Kind) String() string {
+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
+}
+
+func (TracingTagMetadata_Kind) Descriptor() protoreflect.EnumDescriptor {
+ return file_github_com_solo_io_gloo_projects_gloo_api_v1_options_tracing_tracing_proto_enumTypes[0].Descriptor()
+}
+
+func (TracingTagMetadata_Kind) Type() protoreflect.EnumType {
+ return &file_github_com_solo_io_gloo_projects_gloo_api_v1_options_tracing_tracing_proto_enumTypes[0]
+}
+
+func (x TracingTagMetadata_Kind) Number() protoreflect.EnumNumber {
+ return protoreflect.EnumNumber(x)
+}
+
+// Deprecated: Use TracingTagMetadata_Kind.Descriptor instead.
+func (TracingTagMetadata_Kind) EnumDescriptor() ([]byte, []int) {
+ return file_github_com_solo_io_gloo_projects_gloo_api_v1_options_tracing_tracing_proto_rawDescGZIP(), []int{5, 0}
+}
+
// Contains settings for configuring Envoy's tracing capabilities at the listener level.
// See [here](https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/observability/tracing.html) for additional information on Envoy's tracing capabilities.
// See [here](https://docs.solo.io/gloo-edge/latest/guides/observability/tracing/) for additional information about configuring tracing with Gloo Edge.
@@ -55,6 +103,12 @@ type ListenerTracingSettings struct {
EnvironmentVariablesForTags []*TracingTagEnvironmentVariable `protobuf:"bytes,6,rep,name=environment_variables_for_tags,json=environmentVariablesForTags,proto3" json:"environment_variables_for_tags,omitempty"`
// Optional. If specified, Envoy will include the literals with the given tag as tracing tags.
LiteralsForTags []*TracingTagLiteral `protobuf:"bytes,7,rep,name=literals_for_tags,json=literalsForTags,proto3" json:"literals_for_tags,omitempty"`
+ // Optional. If specified, Envoy will include tags from the dynamic metadata.
+ MetadataForTags []*TracingTagMetadata `protobuf:"bytes,11,rep,name=metadata_for_tags,json=metadataForTags,proto3" json:"metadata_for_tags,omitempty"`
+ // 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.
+ SpawnUpstreamSpan bool `protobuf:"varint,10,opt,name=spawn_upstream_span,json=spawnUpstreamSpan,proto3" json:"spawn_upstream_span,omitempty"`
}
func (x *ListenerTracingSettings) Reset() {
@@ -157,6 +211,20 @@ func (x *ListenerTracingSettings) GetLiteralsForTags() []*TracingTagLiteral {
return nil
}
+func (x *ListenerTracingSettings) GetMetadataForTags() []*TracingTagMetadata {
+ if x != nil {
+ return x.MetadataForTags
+ }
+ return nil
+}
+
+func (x *ListenerTracingSettings) GetSpawnUpstreamSpan() bool {
+ if x != nil {
+ return x.SpawnUpstreamSpan
+ }
+ return false
+}
+
type isListenerTracingSettings_ProviderConfig interface {
isListenerTracingSettings_ProviderConfig()
}
@@ -451,6 +519,150 @@ func (x *TracingTagLiteral) GetValue() *wrapperspb.StringValue {
return nil
}
+// Requests can produce traces with custom tags.
+// TracingTagMetadata defines a dynamic metadata tag which gets added as custom tag.
+type TracingTagMetadata struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Used to populate the tag name.
+ Tag string `protobuf:"bytes,1,opt,name=tag,proto3" json:"tag,omitempty"`
+ // The kind of metadata to extract the value from
+ Kind TracingTagMetadata_Kind `protobuf:"varint,2,opt,name=kind,proto3,enum=tracing.options.gloo.solo.io.TracingTagMetadata_Kind" json:"kind,omitempty"`
+ // The metadata value to extract the tag value from.
+ Value *TracingTagMetadata_MetadataValue `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"`
+ // When no valid metadata is found, the tag value would be populated with this default value if specified, otherwise no tag would be populated.
+ DefaultValue string `protobuf:"bytes,4,opt,name=default_value,json=defaultValue,proto3" json:"default_value,omitempty"`
+}
+
+func (x *TracingTagMetadata) Reset() {
+ *x = TracingTagMetadata{}
+ mi := &file_github_com_solo_io_gloo_projects_gloo_api_v1_options_tracing_tracing_proto_msgTypes[5]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *TracingTagMetadata) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*TracingTagMetadata) ProtoMessage() {}
+
+func (x *TracingTagMetadata) ProtoReflect() protoreflect.Message {
+ mi := &file_github_com_solo_io_gloo_projects_gloo_api_v1_options_tracing_tracing_proto_msgTypes[5]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use TracingTagMetadata.ProtoReflect.Descriptor instead.
+func (*TracingTagMetadata) Descriptor() ([]byte, []int) {
+ return file_github_com_solo_io_gloo_projects_gloo_api_v1_options_tracing_tracing_proto_rawDescGZIP(), []int{5}
+}
+
+func (x *TracingTagMetadata) GetTag() string {
+ if x != nil {
+ return x.Tag
+ }
+ return ""
+}
+
+func (x *TracingTagMetadata) GetKind() TracingTagMetadata_Kind {
+ if x != nil {
+ return x.Kind
+ }
+ return TracingTagMetadata_REQUEST
+}
+
+func (x *TracingTagMetadata) GetValue() *TracingTagMetadata_MetadataValue {
+ if x != nil {
+ return x.Value
+ }
+ return nil
+}
+
+func (x *TracingTagMetadata) GetDefaultValue() string {
+ if x != nil {
+ return x.DefaultValue
+ }
+ return ""
+}
+
+type TracingTagMetadata_MetadataValue struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // The namespace to extract the value from the metadata.
+ // If empty will default to JWT principal namespace.
+ Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"`
+ // The key to extract the value from the metadata.
+ // For example, `principal.iss` or `principal.sub` to extract those claims from the JWT ns
+ Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
+ // 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`
+ NestedFieldDelimiter string `protobuf:"bytes,3,opt,name=nested_field_delimiter,json=nestedFieldDelimiter,proto3" json:"nested_field_delimiter,omitempty"`
+}
+
+func (x *TracingTagMetadata_MetadataValue) Reset() {
+ *x = TracingTagMetadata_MetadataValue{}
+ mi := &file_github_com_solo_io_gloo_projects_gloo_api_v1_options_tracing_tracing_proto_msgTypes[6]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *TracingTagMetadata_MetadataValue) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*TracingTagMetadata_MetadataValue) ProtoMessage() {}
+
+func (x *TracingTagMetadata_MetadataValue) ProtoReflect() protoreflect.Message {
+ mi := &file_github_com_solo_io_gloo_projects_gloo_api_v1_options_tracing_tracing_proto_msgTypes[6]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use TracingTagMetadata_MetadataValue.ProtoReflect.Descriptor instead.
+func (*TracingTagMetadata_MetadataValue) Descriptor() ([]byte, []int) {
+ return file_github_com_solo_io_gloo_projects_gloo_api_v1_options_tracing_tracing_proto_rawDescGZIP(), []int{5, 0}
+}
+
+func (x *TracingTagMetadata_MetadataValue) GetNamespace() string {
+ if x != nil {
+ return x.Namespace
+ }
+ return ""
+}
+
+func (x *TracingTagMetadata_MetadataValue) GetKey() string {
+ if x != nil {
+ return x.Key
+ }
+ return ""
+}
+
+func (x *TracingTagMetadata_MetadataValue) GetNestedFieldDelimiter() string {
+ if x != nil {
+ return x.NestedFieldDelimiter
+ }
+ return ""
+}
+
var File_github_com_solo_io_gloo_projects_gloo_api_v1_options_tracing_tracing_proto protoreflect.FileDescriptor
var file_github_com_solo_io_gloo_projects_gloo_api_v1_options_tracing_tracing_proto_rawDesc = []byte{
@@ -491,7 +703,7 @@ var file_github_com_solo_io_gloo_projects_gloo_api_v1_options_tracing_tracing_pr
0x6f, 0x1a, 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x6f,
0x6c, 0x6f, 0x2d, 0x69, 0x6f, 0x2f, 0x73, 0x6f, 0x6c, 0x6f, 0x2d, 0x6b, 0x69, 0x74, 0x2f, 0x61,
0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x66, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22,
- 0xec, 0x06, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x54, 0x72, 0x61, 0x63,
+ 0xfa, 0x07, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x54, 0x72, 0x61, 0x63,
0x69, 0x6e, 0x67, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x55, 0x0a, 0x18, 0x72,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x5f, 0x66,
0x6f, 0x72, 0x5f, 0x74, 0x61, 0x67, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e,
@@ -544,65 +756,99 @@ var file_github_com_solo_io_gloo_projects_gloo_api_v1_options_tracing_tracing_pr
0x69, 0x6e, 0x67, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x67, 0x6c, 0x6f, 0x6f,
0x2e, 0x73, 0x6f, 0x6c, 0x6f, 0x2e, 0x69, 0x6f, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x69, 0x6e, 0x67,
0x54, 0x61, 0x67, 0x4c, 0x69, 0x74, 0x65, 0x72, 0x61, 0x6c, 0x52, 0x0f, 0x6c, 0x69, 0x74, 0x65,
- 0x72, 0x61, 0x6c, 0x73, 0x46, 0x6f, 0x72, 0x54, 0x61, 0x67, 0x73, 0x42, 0x11, 0x0a, 0x0f, 0x70,
- 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0xd8,
- 0x01, 0x0a, 0x14, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x54, 0x72, 0x61, 0x63, 0x69, 0x6e, 0x67, 0x53,
- 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x72, 0x6f, 0x75, 0x74, 0x65,
- 0x5f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28,
- 0x09, 0x52, 0x0f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74,
- 0x6f, 0x72, 0x12, 0x5b, 0x0a, 0x11, 0x74, 0x72, 0x61, 0x63, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x63,
- 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e,
- 0x74, 0x72, 0x61, 0x63, 0x69, 0x6e, 0x67, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e,
- 0x67, 0x6c, 0x6f, 0x6f, 0x2e, 0x73, 0x6f, 0x6c, 0x6f, 0x2e, 0x69, 0x6f, 0x2e, 0x54, 0x72, 0x61,
- 0x63, 0x65, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x73, 0x52, 0x10, 0x74,
- 0x72, 0x61, 0x63, 0x65, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x73, 0x12,
- 0x38, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x70, 0x61, 0x67, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01,
- 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
- 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x09,
- 0x70, 0x72, 0x6f, 0x70, 0x61, 0x67, 0x61, 0x74, 0x65, 0x22, 0x99, 0x02, 0x0a, 0x10, 0x54, 0x72,
- 0x61, 0x63, 0x65, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x73, 0x12, 0x55,
- 0x0a, 0x18, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5f,
- 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b,
- 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
- 0x75, 0x66, 0x2e, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x16, 0x63,
- 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x50, 0x65, 0x72, 0x63, 0x65,
- 0x6e, 0x74, 0x61, 0x67, 0x65, 0x12, 0x55, 0x0a, 0x18, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x5f,
- 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67,
- 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
- 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x56,
- 0x61, 0x6c, 0x75, 0x65, 0x52, 0x16, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x53, 0x61, 0x6d, 0x70,
- 0x6c, 0x65, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x12, 0x57, 0x0a, 0x19,
- 0x6f, 0x76, 0x65, 0x72, 0x61, 0x6c, 0x6c, 0x5f, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5f, 0x70,
- 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32,
- 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
- 0x66, 0x2e, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x17, 0x6f, 0x76,
- 0x65, 0x72, 0x61, 0x6c, 0x6c, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x50, 0x65, 0x72, 0x63, 0x65,
- 0x6e, 0x74, 0x61, 0x67, 0x65, 0x22, 0xc4, 0x01, 0x0a, 0x1d, 0x54, 0x72, 0x61, 0x63, 0x69, 0x6e,
- 0x67, 0x54, 0x61, 0x67, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x56,
- 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x2e, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x01,
- 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72,
- 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c,
- 0x75, 0x65, 0x52, 0x03, 0x74, 0x61, 0x67, 0x12, 0x30, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18,
- 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70,
- 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61,
- 0x6c, 0x75, 0x65, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x41, 0x0a, 0x0d, 0x64, 0x65, 0x66,
- 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b,
- 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
- 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0c,
- 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x77, 0x0a, 0x11,
- 0x54, 0x72, 0x61, 0x63, 0x69, 0x6e, 0x67, 0x54, 0x61, 0x67, 0x4c, 0x69, 0x74, 0x65, 0x72, 0x61,
- 0x6c, 0x12, 0x2e, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c,
+ 0x72, 0x61, 0x6c, 0x73, 0x46, 0x6f, 0x72, 0x54, 0x61, 0x67, 0x73, 0x12, 0x5c, 0x0a, 0x11, 0x6d,
+ 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x66, 0x6f, 0x72, 0x5f, 0x74, 0x61, 0x67, 0x73,
+ 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x69, 0x6e, 0x67,
+ 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x67, 0x6c, 0x6f, 0x6f, 0x2e, 0x73, 0x6f,
+ 0x6c, 0x6f, 0x2e, 0x69, 0x6f, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x69, 0x6e, 0x67, 0x54, 0x61, 0x67,
+ 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x0f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61,
+ 0x74, 0x61, 0x46, 0x6f, 0x72, 0x54, 0x61, 0x67, 0x73, 0x12, 0x2e, 0x0a, 0x13, 0x73, 0x70, 0x61,
+ 0x77, 0x6e, 0x5f, 0x75, 0x70, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x5f, 0x73, 0x70, 0x61, 0x6e,
+ 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x73, 0x70, 0x61, 0x77, 0x6e, 0x55, 0x70, 0x73,
+ 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x70, 0x61, 0x6e, 0x42, 0x11, 0x0a, 0x0f, 0x70, 0x72, 0x6f,
+ 0x76, 0x69, 0x64, 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0xd8, 0x01, 0x0a,
+ 0x14, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x54, 0x72, 0x61, 0x63, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x74,
+ 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x5f, 0x64,
+ 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
+ 0x0f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72,
+ 0x12, 0x5b, 0x0a, 0x11, 0x74, 0x72, 0x61, 0x63, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e,
+ 0x74, 0x61, 0x67, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x74, 0x72,
+ 0x61, 0x63, 0x69, 0x6e, 0x67, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x67, 0x6c,
+ 0x6f, 0x6f, 0x2e, 0x73, 0x6f, 0x6c, 0x6f, 0x2e, 0x69, 0x6f, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x65,
+ 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x73, 0x52, 0x10, 0x74, 0x72, 0x61,
+ 0x63, 0x65, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x73, 0x12, 0x38, 0x0a,
+ 0x09, 0x70, 0x72, 0x6f, 0x70, 0x61, 0x67, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b,
+ 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
+ 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x09, 0x70, 0x72,
+ 0x6f, 0x70, 0x61, 0x67, 0x61, 0x74, 0x65, 0x22, 0x99, 0x02, 0x0a, 0x10, 0x54, 0x72, 0x61, 0x63,
+ 0x65, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x73, 0x12, 0x55, 0x0a, 0x18,
+ 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5f, 0x70, 0x65,
+ 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b,
+ 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
+ 0x2e, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x16, 0x63, 0x6c, 0x69,
+ 0x65, 0x6e, 0x74, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74,
+ 0x61, 0x67, 0x65, 0x12, 0x55, 0x0a, 0x18, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x5f, 0x73, 0x61,
+ 0x6d, 0x70, 0x6c, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x18,
+ 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70,
+ 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x56, 0x61, 0x6c,
+ 0x75, 0x65, 0x52, 0x16, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65,
+ 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x12, 0x57, 0x0a, 0x19, 0x6f, 0x76,
+ 0x65, 0x72, 0x61, 0x6c, 0x6c, 0x5f, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5f, 0x70, 0x65, 0x72,
+ 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e,
+ 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e,
+ 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x17, 0x6f, 0x76, 0x65, 0x72,
+ 0x61, 0x6c, 0x6c, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74,
+ 0x61, 0x67, 0x65, 0x22, 0xc4, 0x01, 0x0a, 0x1d, 0x54, 0x72, 0x61, 0x63, 0x69, 0x6e, 0x67, 0x54,
+ 0x61, 0x67, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x56, 0x61, 0x72,
+ 0x69, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x2e, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x01, 0x20, 0x01,
+ 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
+ 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65,
+ 0x52, 0x03, 0x74, 0x61, 0x67, 0x12, 0x30, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20,
+ 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f,
+ 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75,
+ 0x65, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x41, 0x0a, 0x0d, 0x64, 0x65, 0x66, 0x61, 0x75,
+ 0x6c, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c,
0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
- 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x03, 0x74, 0x61,
- 0x67, 0x12, 0x32, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b,
- 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
- 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05,
- 0x76, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x4e, 0xb8, 0xf5, 0x04, 0x01, 0xc0, 0xf5, 0x04, 0x01, 0xd0,
- 0xf5, 0x04, 0x01, 0x5a, 0x40, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,
- 0x73, 0x6f, 0x6c, 0x6f, 0x2d, 0x69, 0x6f, 0x2f, 0x67, 0x6c, 0x6f, 0x6f, 0x2f, 0x70, 0x72, 0x6f,
- 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x67, 0x6c, 0x6f, 0x6f, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61,
- 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x74, 0x72,
- 0x61, 0x63, 0x69, 0x6e, 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+ 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0c, 0x64, 0x65,
+ 0x66, 0x61, 0x75, 0x6c, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x77, 0x0a, 0x11, 0x54, 0x72,
+ 0x61, 0x63, 0x69, 0x6e, 0x67, 0x54, 0x61, 0x67, 0x4c, 0x69, 0x74, 0x65, 0x72, 0x61, 0x6c, 0x12,
+ 0x2e, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67,
+ 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53,
+ 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x03, 0x74, 0x61, 0x67, 0x12,
+ 0x32, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c,
+ 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
+ 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61,
+ 0x6c, 0x75, 0x65, 0x22, 0x86, 0x03, 0x0a, 0x12, 0x54, 0x72, 0x61, 0x63, 0x69, 0x6e, 0x67, 0x54,
+ 0x61, 0x67, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61,
+ 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, 0x61, 0x67, 0x12, 0x49, 0x0a, 0x04,
+ 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x35, 0x2e, 0x74, 0x72, 0x61,
+ 0x63, 0x69, 0x6e, 0x67, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x67, 0x6c, 0x6f,
+ 0x6f, 0x2e, 0x73, 0x6f, 0x6c, 0x6f, 0x2e, 0x69, 0x6f, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x69, 0x6e,
+ 0x67, 0x54, 0x61, 0x67, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x4b, 0x69, 0x6e,
+ 0x64, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x54, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65,
+ 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3e, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x69, 0x6e, 0x67,
+ 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x67, 0x6c, 0x6f, 0x6f, 0x2e, 0x73, 0x6f,
+ 0x6c, 0x6f, 0x2e, 0x69, 0x6f, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x69, 0x6e, 0x67, 0x54, 0x61, 0x67,
+ 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74,
+ 0x61, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a,
+ 0x0d, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04,
+ 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x56, 0x61, 0x6c,
+ 0x75, 0x65, 0x1a, 0x75, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x56, 0x61,
+ 0x6c, 0x75, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65,
+ 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63,
+ 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03,
+ 0x6b, 0x65, 0x79, 0x12, 0x34, 0x0a, 0x16, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x69,
+ 0x65, 0x6c, 0x64, 0x5f, 0x64, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20,
+ 0x01, 0x28, 0x09, 0x52, 0x14, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x46, 0x69, 0x65, 0x6c, 0x64,
+ 0x44, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x22, 0x21, 0x0a, 0x04, 0x4b, 0x69, 0x6e,
+ 0x64, 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x10, 0x00, 0x12, 0x0c,
+ 0x0a, 0x08, 0x45, 0x4e, 0x44, 0x50, 0x4f, 0x49, 0x4e, 0x54, 0x10, 0x01, 0x42, 0x4e, 0xb8, 0xf5,
+ 0x04, 0x01, 0xc0, 0xf5, 0x04, 0x01, 0xd0, 0xf5, 0x04, 0x01, 0x5a, 0x40, 0x67, 0x69, 0x74, 0x68,
+ 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x6f, 0x6c, 0x6f, 0x2d, 0x69, 0x6f, 0x2f, 0x67,
+ 0x6c, 0x6f, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x67, 0x6c, 0x6f,
+ 0x6f, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x70, 0x74,
+ 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x74, 0x72, 0x61, 0x63, 0x69, 0x6e, 0x67, 0x62, 0x06, 0x70, 0x72,
+ 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -617,46 +863,53 @@ func file_github_com_solo_io_gloo_projects_gloo_api_v1_options_tracing_tracing_p
return file_github_com_solo_io_gloo_projects_gloo_api_v1_options_tracing_tracing_proto_rawDescData
}
-var file_github_com_solo_io_gloo_projects_gloo_api_v1_options_tracing_tracing_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
+var file_github_com_solo_io_gloo_projects_gloo_api_v1_options_tracing_tracing_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
+var file_github_com_solo_io_gloo_projects_gloo_api_v1_options_tracing_tracing_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
var file_github_com_solo_io_gloo_projects_gloo_api_v1_options_tracing_tracing_proto_goTypes = []any{
- (*ListenerTracingSettings)(nil), // 0: tracing.options.gloo.solo.io.ListenerTracingSettings
- (*RouteTracingSettings)(nil), // 1: tracing.options.gloo.solo.io.RouteTracingSettings
- (*TracePercentages)(nil), // 2: tracing.options.gloo.solo.io.TracePercentages
- (*TracingTagEnvironmentVariable)(nil), // 3: tracing.options.gloo.solo.io.TracingTagEnvironmentVariable
- (*TracingTagLiteral)(nil), // 4: tracing.options.gloo.solo.io.TracingTagLiteral
- (*wrapperspb.StringValue)(nil), // 5: google.protobuf.StringValue
- (*wrapperspb.BoolValue)(nil), // 6: google.protobuf.BoolValue
- (*v3.ZipkinConfig)(nil), // 7: solo.io.envoy.config.trace.v3.ZipkinConfig
- (*v3.DatadogConfig)(nil), // 8: solo.io.envoy.config.trace.v3.DatadogConfig
- (*v3.OpenTelemetryConfig)(nil), // 9: solo.io.envoy.config.trace.v3.OpenTelemetryConfig
- (*v3.OpenCensusConfig)(nil), // 10: solo.io.envoy.config.trace.v3.OpenCensusConfig
- (*wrapperspb.FloatValue)(nil), // 11: google.protobuf.FloatValue
+ (TracingTagMetadata_Kind)(0), // 0: tracing.options.gloo.solo.io.TracingTagMetadata.Kind
+ (*ListenerTracingSettings)(nil), // 1: tracing.options.gloo.solo.io.ListenerTracingSettings
+ (*RouteTracingSettings)(nil), // 2: tracing.options.gloo.solo.io.RouteTracingSettings
+ (*TracePercentages)(nil), // 3: tracing.options.gloo.solo.io.TracePercentages
+ (*TracingTagEnvironmentVariable)(nil), // 4: tracing.options.gloo.solo.io.TracingTagEnvironmentVariable
+ (*TracingTagLiteral)(nil), // 5: tracing.options.gloo.solo.io.TracingTagLiteral
+ (*TracingTagMetadata)(nil), // 6: tracing.options.gloo.solo.io.TracingTagMetadata
+ (*TracingTagMetadata_MetadataValue)(nil), // 7: tracing.options.gloo.solo.io.TracingTagMetadata.MetadataValue
+ (*wrapperspb.StringValue)(nil), // 8: google.protobuf.StringValue
+ (*wrapperspb.BoolValue)(nil), // 9: google.protobuf.BoolValue
+ (*v3.ZipkinConfig)(nil), // 10: solo.io.envoy.config.trace.v3.ZipkinConfig
+ (*v3.DatadogConfig)(nil), // 11: solo.io.envoy.config.trace.v3.DatadogConfig
+ (*v3.OpenTelemetryConfig)(nil), // 12: solo.io.envoy.config.trace.v3.OpenTelemetryConfig
+ (*v3.OpenCensusConfig)(nil), // 13: solo.io.envoy.config.trace.v3.OpenCensusConfig
+ (*wrapperspb.FloatValue)(nil), // 14: google.protobuf.FloatValue
}
var file_github_com_solo_io_gloo_projects_gloo_api_v1_options_tracing_tracing_proto_depIdxs = []int32{
- 5, // 0: tracing.options.gloo.solo.io.ListenerTracingSettings.request_headers_for_tags:type_name -> google.protobuf.StringValue
- 6, // 1: tracing.options.gloo.solo.io.ListenerTracingSettings.verbose:type_name -> google.protobuf.BoolValue
- 2, // 2: tracing.options.gloo.solo.io.ListenerTracingSettings.trace_percentages:type_name -> tracing.options.gloo.solo.io.TracePercentages
- 7, // 3: tracing.options.gloo.solo.io.ListenerTracingSettings.zipkin_config:type_name -> solo.io.envoy.config.trace.v3.ZipkinConfig
- 8, // 4: tracing.options.gloo.solo.io.ListenerTracingSettings.datadog_config:type_name -> solo.io.envoy.config.trace.v3.DatadogConfig
- 9, // 5: tracing.options.gloo.solo.io.ListenerTracingSettings.open_telemetry_config:type_name -> solo.io.envoy.config.trace.v3.OpenTelemetryConfig
- 10, // 6: tracing.options.gloo.solo.io.ListenerTracingSettings.open_census_config:type_name -> solo.io.envoy.config.trace.v3.OpenCensusConfig
- 3, // 7: tracing.options.gloo.solo.io.ListenerTracingSettings.environment_variables_for_tags:type_name -> tracing.options.gloo.solo.io.TracingTagEnvironmentVariable
- 4, // 8: tracing.options.gloo.solo.io.ListenerTracingSettings.literals_for_tags:type_name -> tracing.options.gloo.solo.io.TracingTagLiteral
- 2, // 9: tracing.options.gloo.solo.io.RouteTracingSettings.trace_percentages:type_name -> tracing.options.gloo.solo.io.TracePercentages
- 6, // 10: tracing.options.gloo.solo.io.RouteTracingSettings.propagate:type_name -> google.protobuf.BoolValue
- 11, // 11: tracing.options.gloo.solo.io.TracePercentages.client_sample_percentage:type_name -> google.protobuf.FloatValue
- 11, // 12: tracing.options.gloo.solo.io.TracePercentages.random_sample_percentage:type_name -> google.protobuf.FloatValue
- 11, // 13: tracing.options.gloo.solo.io.TracePercentages.overall_sample_percentage:type_name -> google.protobuf.FloatValue
- 5, // 14: tracing.options.gloo.solo.io.TracingTagEnvironmentVariable.tag:type_name -> google.protobuf.StringValue
- 5, // 15: tracing.options.gloo.solo.io.TracingTagEnvironmentVariable.name:type_name -> google.protobuf.StringValue
- 5, // 16: tracing.options.gloo.solo.io.TracingTagEnvironmentVariable.default_value:type_name -> google.protobuf.StringValue
- 5, // 17: tracing.options.gloo.solo.io.TracingTagLiteral.tag:type_name -> google.protobuf.StringValue
- 5, // 18: tracing.options.gloo.solo.io.TracingTagLiteral.value:type_name -> google.protobuf.StringValue
- 19, // [19:19] is the sub-list for method output_type
- 19, // [19:19] is the sub-list for method input_type
- 19, // [19:19] is the sub-list for extension type_name
- 19, // [19:19] is the sub-list for extension extendee
- 0, // [0:19] is the sub-list for field type_name
+ 8, // 0: tracing.options.gloo.solo.io.ListenerTracingSettings.request_headers_for_tags:type_name -> google.protobuf.StringValue
+ 9, // 1: tracing.options.gloo.solo.io.ListenerTracingSettings.verbose:type_name -> google.protobuf.BoolValue
+ 3, // 2: tracing.options.gloo.solo.io.ListenerTracingSettings.trace_percentages:type_name -> tracing.options.gloo.solo.io.TracePercentages
+ 10, // 3: tracing.options.gloo.solo.io.ListenerTracingSettings.zipkin_config:type_name -> solo.io.envoy.config.trace.v3.ZipkinConfig
+ 11, // 4: tracing.options.gloo.solo.io.ListenerTracingSettings.datadog_config:type_name -> solo.io.envoy.config.trace.v3.DatadogConfig
+ 12, // 5: tracing.options.gloo.solo.io.ListenerTracingSettings.open_telemetry_config:type_name -> solo.io.envoy.config.trace.v3.OpenTelemetryConfig
+ 13, // 6: tracing.options.gloo.solo.io.ListenerTracingSettings.open_census_config:type_name -> solo.io.envoy.config.trace.v3.OpenCensusConfig
+ 4, // 7: tracing.options.gloo.solo.io.ListenerTracingSettings.environment_variables_for_tags:type_name -> tracing.options.gloo.solo.io.TracingTagEnvironmentVariable
+ 5, // 8: tracing.options.gloo.solo.io.ListenerTracingSettings.literals_for_tags:type_name -> tracing.options.gloo.solo.io.TracingTagLiteral
+ 6, // 9: tracing.options.gloo.solo.io.ListenerTracingSettings.metadata_for_tags:type_name -> tracing.options.gloo.solo.io.TracingTagMetadata
+ 3, // 10: tracing.options.gloo.solo.io.RouteTracingSettings.trace_percentages:type_name -> tracing.options.gloo.solo.io.TracePercentages
+ 9, // 11: tracing.options.gloo.solo.io.RouteTracingSettings.propagate:type_name -> google.protobuf.BoolValue
+ 14, // 12: tracing.options.gloo.solo.io.TracePercentages.client_sample_percentage:type_name -> google.protobuf.FloatValue
+ 14, // 13: tracing.options.gloo.solo.io.TracePercentages.random_sample_percentage:type_name -> google.protobuf.FloatValue
+ 14, // 14: tracing.options.gloo.solo.io.TracePercentages.overall_sample_percentage:type_name -> google.protobuf.FloatValue
+ 8, // 15: tracing.options.gloo.solo.io.TracingTagEnvironmentVariable.tag:type_name -> google.protobuf.StringValue
+ 8, // 16: tracing.options.gloo.solo.io.TracingTagEnvironmentVariable.name:type_name -> google.protobuf.StringValue
+ 8, // 17: tracing.options.gloo.solo.io.TracingTagEnvironmentVariable.default_value:type_name -> google.protobuf.StringValue
+ 8, // 18: tracing.options.gloo.solo.io.TracingTagLiteral.tag:type_name -> google.protobuf.StringValue
+ 8, // 19: tracing.options.gloo.solo.io.TracingTagLiteral.value:type_name -> google.protobuf.StringValue
+ 0, // 20: tracing.options.gloo.solo.io.TracingTagMetadata.kind:type_name -> tracing.options.gloo.solo.io.TracingTagMetadata.Kind
+ 7, // 21: tracing.options.gloo.solo.io.TracingTagMetadata.value:type_name -> tracing.options.gloo.solo.io.TracingTagMetadata.MetadataValue
+ 22, // [22:22] is the sub-list for method output_type
+ 22, // [22:22] is the sub-list for method input_type
+ 22, // [22:22] is the sub-list for extension type_name
+ 22, // [22:22] is the sub-list for extension extendee
+ 0, // [0:22] is the sub-list for field type_name
}
func init() { file_github_com_solo_io_gloo_projects_gloo_api_v1_options_tracing_tracing_proto_init() }
@@ -675,13 +928,14 @@ func file_github_com_solo_io_gloo_projects_gloo_api_v1_options_tracing_tracing_p
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_github_com_solo_io_gloo_projects_gloo_api_v1_options_tracing_tracing_proto_rawDesc,
- NumEnums: 0,
- NumMessages: 5,
+ NumEnums: 1,
+ NumMessages: 7,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_github_com_solo_io_gloo_projects_gloo_api_v1_options_tracing_tracing_proto_goTypes,
DependencyIndexes: file_github_com_solo_io_gloo_projects_gloo_api_v1_options_tracing_tracing_proto_depIdxs,
+ EnumInfos: file_github_com_solo_io_gloo_projects_gloo_api_v1_options_tracing_tracing_proto_enumTypes,
MessageInfos: file_github_com_solo_io_gloo_projects_gloo_api_v1_options_tracing_tracing_proto_msgTypes,
}.Build()
File_github_com_solo_io_gloo_projects_gloo_api_v1_options_tracing_tracing_proto = out.File
diff --git a/projects/gloo/pkg/api/v1/options/tracing/tracing.pb.hash.go b/projects/gloo/pkg/api/v1/options/tracing/tracing.pb.hash.go
index 546a8be29b2..579573d0fce 100644
--- a/projects/gloo/pkg/api/v1/options/tracing/tracing.pb.hash.go
+++ b/projects/gloo/pkg/api/v1/options/tracing/tracing.pb.hash.go
@@ -154,6 +154,35 @@ func (m *ListenerTracingSettings) Hash(hasher hash.Hash64) (uint64, error) {
}
+ for _, v := range m.GetMetadataForTags() {
+
+ if h, ok := interface{}(v).(safe_hasher.SafeHasher); ok {
+ if _, err = hasher.Write([]byte("")); err != nil {
+ return 0, err
+ }
+ if _, err = h.Hash(hasher); err != nil {
+ return 0, err
+ }
+ } else {
+ if fieldValue, err := hashstructure.Hash(v, nil); err != nil {
+ return 0, err
+ } else {
+ if _, err = hasher.Write([]byte("")); err != nil {
+ return 0, err
+ }
+ if err := binary.Write(hasher, binary.LittleEndian, fieldValue); err != nil {
+ return 0, err
+ }
+ }
+ }
+
+ }
+
+ err = binary.Write(hasher, binary.LittleEndian, m.GetSpawnUpstreamSpan())
+ if err != nil {
+ return 0, err
+ }
+
switch m.ProviderConfig.(type) {
case *ListenerTracingSettings_ZipkinConfig:
@@ -532,3 +561,88 @@ func (m *TracingTagLiteral) Hash(hasher hash.Hash64) (uint64, error) {
return hasher.Sum64(), nil
}
+
+// Hash function
+//
+// Deprecated: due to hashing implemention only using field values. The omission
+// of the field name in the hash calculation can lead to hash collisions.
+// Prefer the HashUnique function instead.
+func (m *TracingTagMetadata) Hash(hasher hash.Hash64) (uint64, error) {
+ if m == nil {
+ return 0, nil
+ }
+ if hasher == nil {
+ hasher = fnv.New64()
+ }
+ var err error
+ if _, err = hasher.Write([]byte("tracing.options.gloo.solo.io.github.com/solo-io/gloo/projects/gloo/pkg/api/v1/options/tracing.TracingTagMetadata")); err != nil {
+ return 0, err
+ }
+
+ if _, err = hasher.Write([]byte(m.GetTag())); err != nil {
+ return 0, err
+ }
+
+ err = binary.Write(hasher, binary.LittleEndian, m.GetKind())
+ if err != nil {
+ return 0, err
+ }
+
+ if h, ok := interface{}(m.GetValue()).(safe_hasher.SafeHasher); ok {
+ if _, err = hasher.Write([]byte("Value")); err != nil {
+ return 0, err
+ }
+ if _, err = h.Hash(hasher); err != nil {
+ return 0, err
+ }
+ } else {
+ if fieldValue, err := hashstructure.Hash(m.GetValue(), nil); err != nil {
+ return 0, err
+ } else {
+ if _, err = hasher.Write([]byte("Value")); err != nil {
+ return 0, err
+ }
+ if err := binary.Write(hasher, binary.LittleEndian, fieldValue); err != nil {
+ return 0, err
+ }
+ }
+ }
+
+ if _, err = hasher.Write([]byte(m.GetDefaultValue())); err != nil {
+ return 0, err
+ }
+
+ return hasher.Sum64(), nil
+}
+
+// Hash function
+//
+// Deprecated: due to hashing implemention only using field values. The omission
+// of the field name in the hash calculation can lead to hash collisions.
+// Prefer the HashUnique function instead.
+func (m *TracingTagMetadata_MetadataValue) Hash(hasher hash.Hash64) (uint64, error) {
+ if m == nil {
+ return 0, nil
+ }
+ if hasher == nil {
+ hasher = fnv.New64()
+ }
+ var err error
+ if _, err = hasher.Write([]byte("tracing.options.gloo.solo.io.github.com/solo-io/gloo/projects/gloo/pkg/api/v1/options/tracing.TracingTagMetadata_MetadataValue")); err != nil {
+ return 0, err
+ }
+
+ if _, err = hasher.Write([]byte(m.GetNamespace())); err != nil {
+ return 0, err
+ }
+
+ if _, err = hasher.Write([]byte(m.GetKey())); err != nil {
+ return 0, err
+ }
+
+ if _, err = hasher.Write([]byte(m.GetNestedFieldDelimiter())); err != nil {
+ return 0, err
+ }
+
+ return hasher.Sum64(), nil
+}
diff --git a/projects/gloo/pkg/api/v1/options/tracing/tracing.pb.uniquehash.go b/projects/gloo/pkg/api/v1/options/tracing/tracing.pb.uniquehash.go
index 5c9fe0932c0..e641e0a7520 100644
--- a/projects/gloo/pkg/api/v1/options/tracing/tracing.pb.uniquehash.go
+++ b/projects/gloo/pkg/api/v1/options/tracing/tracing.pb.uniquehash.go
@@ -173,6 +173,44 @@ func (m *ListenerTracingSettings) HashUnique(hasher hash.Hash64) (uint64, error)
}
+ if _, err = hasher.Write([]byte("MetadataForTags")); err != nil {
+ return 0, err
+ }
+ for i, v := range m.GetMetadataForTags() {
+ if _, err = hasher.Write([]byte(strconv.Itoa(i))); err != nil {
+ return 0, err
+ }
+
+ if h, ok := interface{}(v).(safe_hasher.SafeHasher); ok {
+ if _, err = hasher.Write([]byte("v")); err != nil {
+ return 0, err
+ }
+ if _, err = h.Hash(hasher); err != nil {
+ return 0, err
+ }
+ } else {
+ if fieldValue, err := hashstructure.Hash(v, nil); err != nil {
+ return 0, err
+ } else {
+ if _, err = hasher.Write([]byte("v")); err != nil {
+ return 0, err
+ }
+ if err := binary.Write(hasher, binary.LittleEndian, fieldValue); err != nil {
+ return 0, err
+ }
+ }
+ }
+
+ }
+
+ if _, err = hasher.Write([]byte("SpawnUpstreamSpan")); err != nil {
+ return 0, err
+ }
+ err = binary.Write(hasher, binary.LittleEndian, m.GetSpawnUpstreamSpan())
+ if err != nil {
+ return 0, err
+ }
+
switch m.ProviderConfig.(type) {
case *ListenerTracingSettings_ZipkinConfig:
@@ -550,3 +588,104 @@ func (m *TracingTagLiteral) HashUnique(hasher hash.Hash64) (uint64, error) {
return hasher.Sum64(), nil
}
+
+// HashUnique function generates a hash of the object that is unique to the object by
+// hashing field name and value pairs.
+// Replaces Hash due to original hashing implemention only using field values. The omission
+// of the field name in the hash calculation can lead to hash collisions.
+func (m *TracingTagMetadata) HashUnique(hasher hash.Hash64) (uint64, error) {
+ if m == nil {
+ return 0, nil
+ }
+ if hasher == nil {
+ hasher = fnv.New64()
+ }
+ var err error
+ if _, err = hasher.Write([]byte("tracing.options.gloo.solo.io.github.com/solo-io/gloo/projects/gloo/pkg/api/v1/options/tracing.TracingTagMetadata")); err != nil {
+ return 0, err
+ }
+
+ if _, err = hasher.Write([]byte("Tag")); err != nil {
+ return 0, err
+ }
+ if _, err = hasher.Write([]byte(m.GetTag())); err != nil {
+ return 0, err
+ }
+
+ if _, err = hasher.Write([]byte("Kind")); err != nil {
+ return 0, err
+ }
+ err = binary.Write(hasher, binary.LittleEndian, m.GetKind())
+ if err != nil {
+ return 0, err
+ }
+
+ if h, ok := interface{}(m.GetValue()).(safe_hasher.SafeHasher); ok {
+ if _, err = hasher.Write([]byte("Value")); err != nil {
+ return 0, err
+ }
+ if _, err = h.Hash(hasher); err != nil {
+ return 0, err
+ }
+ } else {
+ if fieldValue, err := hashstructure.Hash(m.GetValue(), nil); err != nil {
+ return 0, err
+ } else {
+ if _, err = hasher.Write([]byte("Value")); err != nil {
+ return 0, err
+ }
+ if err := binary.Write(hasher, binary.LittleEndian, fieldValue); err != nil {
+ return 0, err
+ }
+ }
+ }
+
+ if _, err = hasher.Write([]byte("DefaultValue")); err != nil {
+ return 0, err
+ }
+ if _, err = hasher.Write([]byte(m.GetDefaultValue())); err != nil {
+ return 0, err
+ }
+
+ return hasher.Sum64(), nil
+}
+
+// HashUnique function generates a hash of the object that is unique to the object by
+// hashing field name and value pairs.
+// Replaces Hash due to original hashing implemention only using field values. The omission
+// of the field name in the hash calculation can lead to hash collisions.
+func (m *TracingTagMetadata_MetadataValue) HashUnique(hasher hash.Hash64) (uint64, error) {
+ if m == nil {
+ return 0, nil
+ }
+ if hasher == nil {
+ hasher = fnv.New64()
+ }
+ var err error
+ if _, err = hasher.Write([]byte("tracing.options.gloo.solo.io.github.com/solo-io/gloo/projects/gloo/pkg/api/v1/options/tracing.TracingTagMetadata_MetadataValue")); err != nil {
+ return 0, err
+ }
+
+ if _, err = hasher.Write([]byte("Namespace")); err != nil {
+ return 0, err
+ }
+ if _, err = hasher.Write([]byte(m.GetNamespace())); err != nil {
+ return 0, err
+ }
+
+ if _, err = hasher.Write([]byte("Key")); err != nil {
+ return 0, err
+ }
+ if _, err = hasher.Write([]byte(m.GetKey())); err != nil {
+ return 0, err
+ }
+
+ if _, err = hasher.Write([]byte("NestedFieldDelimiter")); err != nil {
+ return 0, err
+ }
+ if _, err = hasher.Write([]byte(m.GetNestedFieldDelimiter())); err != nil {
+ return 0, err
+ }
+
+ return hasher.Sum64(), nil
+}
diff --git a/projects/gloo/pkg/plugins/tracing/plugin.go b/projects/gloo/pkg/plugins/tracing/plugin.go
index 5c32447cd3b..c697df5510f 100644
--- a/projects/gloo/pkg/plugins/tracing/plugin.go
+++ b/projects/gloo/pkg/plugins/tracing/plugin.go
@@ -1,9 +1,12 @@
package tracing
import (
+ "strings"
+
envoy_config_route_v3 "github.com/envoyproxy/go-control-plane/envoy/config/route/v3"
envoy_config_trace_v3 "github.com/envoyproxy/go-control-plane/envoy/config/trace/v3"
envoyhttp "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/network/http_connection_manager/v3"
+ envoy_type_metadata_v3 "github.com/envoyproxy/go-control-plane/envoy/type/metadata/v3"
envoytracing "github.com/envoyproxy/go-control-plane/envoy/type/tracing/v3"
envoy_type "github.com/envoyproxy/go-control-plane/envoy/type/v3"
"github.com/golang/protobuf/ptypes"
@@ -19,6 +22,8 @@ import (
"github.com/solo-io/gloo/projects/gloo/pkg/plugins/pluginutils"
translatorutil "github.com/solo-io/gloo/projects/gloo/pkg/translator"
"github.com/solo-io/solo-kit/pkg/api/v1/resources/core"
+ "google.golang.org/protobuf/types/known/wrapperspb"
+ "istio.io/istio/pkg/slices"
)
var (
@@ -86,7 +91,9 @@ func (p *plugin) ProcessHcmNetworkFilter(params plugins.Params, parent *v1.Liste
trCfg.RandomSampling = envoySimplePercent(oneHundredPercent)
trCfg.OverallSampling = envoySimplePercent(oneHundredPercent)
}
+ trCfg.SpawnUpstreamSpan = wrapperspb.Bool(tracingSettings.GetSpawnUpstreamSpan())
out.Tracing = trCfg
+
return nil
}
@@ -127,6 +134,38 @@ func customTags(tracingSettings *tracing.ListenerTracingSettings) []*envoytracin
}
customTags = append(customTags, tag)
}
+ for _, metadataTag := range tracingSettings.GetMetadataForTags() {
+ keyDelimiter := "."
+ if metadataTag.GetValue().GetNestedFieldDelimiter() != "" {
+ keyDelimiter = metadataTag.GetValue().GetNestedFieldDelimiter()
+ }
+ tag := &envoytracing.CustomTag_Metadata{
+ MetadataKey: &envoy_type_metadata_v3.MetadataKey{
+ Key: metadataTag.GetValue().GetNamespace(),
+ Path: slices.Map(strings.Split(metadataTag.GetValue().GetKey(), keyDelimiter), func(key string) *envoy_type_metadata_v3.MetadataKey_PathSegment {
+ return &envoy_type_metadata_v3.MetadataKey_PathSegment{Segment: &envoy_type_metadata_v3.MetadataKey_PathSegment_Key{Key: key}}
+ }),
+ },
+ DefaultValue: metadataTag.GetDefaultValue(),
+ }
+ switch metadataTag.GetKind() {
+ case tracing.TracingTagMetadata_REQUEST:
+ tag.Kind = &envoy_type_metadata_v3.MetadataKind{
+ Kind: &envoy_type_metadata_v3.MetadataKind_Request_{Request: &envoy_type_metadata_v3.MetadataKind_Request{}},
+ }
+ case tracing.TracingTagMetadata_ENDPOINT:
+ tag.Kind = &envoy_type_metadata_v3.MetadataKind{
+ Kind: &envoy_type_metadata_v3.MetadataKind_Host_{Host: &envoy_type_metadata_v3.MetadataKind_Host{}},
+ }
+
+ }
+ customTags = append(customTags, &envoytracing.CustomTag{
+ Tag: metadataTag.GetTag(),
+ Type: &envoytracing.CustomTag_Metadata_{
+ Metadata: tag,
+ },
+ })
+ }
return customTags
}
@@ -259,7 +298,11 @@ func processEnvoyOpenTelemetryTracing(
return nil, errors.Errorf("Unsupported Tracing.ProviderConfiguration: %v", collectorCluster)
}
- serviceName := api_conversion.GetGatewayNameFromParent(params.Ctx, parent)
+ serviceName := openTelemetryTracingSettings.OpenTelemetryConfig.GetServiceName()
+ if serviceName == "" {
+ serviceName = api_conversion.GetGatewayNameFromParent(params.Ctx, parent)
+ }
+
envoyConfig := api_conversion.ToEnvoyOpenTelemetryConfiguration(collectorClusterName, serviceName)
marshalledEnvoyConfig, err := ptypes.MarshalAny(envoyConfig)
diff --git a/projects/gloo/pkg/plugins/tracing/plugin_test.go b/projects/gloo/pkg/plugins/tracing/plugin_test.go
index 314a95d24a2..81c951f5f6f 100644
--- a/projects/gloo/pkg/plugins/tracing/plugin_test.go
+++ b/projects/gloo/pkg/plugins/tracing/plugin_test.go
@@ -6,6 +6,7 @@ import (
envoy_config_route_v3 "github.com/envoyproxy/go-control-plane/envoy/config/route/v3"
envoytrace "github.com/envoyproxy/go-control-plane/envoy/config/trace/v3"
envoyhttp "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/network/http_connection_manager/v3"
+ envoy_type_metadata_v3 "github.com/envoyproxy/go-control-plane/envoy/type/metadata/v3"
envoytracing "github.com/envoyproxy/go-control-plane/envoy/type/tracing/v3"
envoy_type "github.com/envoyproxy/go-control-plane/envoy/type/v3"
"github.com/golang/protobuf/ptypes"
@@ -94,6 +95,34 @@ var _ = Describe("Plugin", func() {
Value: &wrappers.StringValue{Value: "bar"},
},
},
+ MetadataForTags: []*tracing.TracingTagMetadata{
+ {
+ Tag: "envoy.metadata.foo",
+ Kind: tracing.TracingTagMetadata_REQUEST,
+ Value: &tracing.TracingTagMetadata_MetadataValue{
+ Namespace: "namespace",
+ Key: "nested.key",
+ },
+ },
+ {
+ Tag: "envoy.metadata.bar",
+ Kind: tracing.TracingTagMetadata_ENDPOINT,
+ Value: &tracing.TracingTagMetadata_MetadataValue{
+ Namespace: "namespace",
+ Key: "nested.key",
+ },
+ },
+ {
+ Tag: "envoy.metadata.baz",
+ Kind: tracing.TracingTagMetadata_REQUEST,
+ DefaultValue: "default",
+ Value: &tracing.TracingTagMetadata_MetadataValue{
+ Namespace: "namespace",
+ Key: "nested:key",
+ NestedFieldDelimiter: ":",
+ },
+ },
+ },
Verbose: &wrappers.BoolValue{Value: true},
TracePercentages: &tracing.TracePercentages{
ClientSamplePercentage: &wrappers.FloatValue{Value: 10},
@@ -108,6 +137,7 @@ var _ = Describe("Plugin", func() {
Expect(err).NotTo(HaveOccurred())
expected := &envoyhttp.HttpConnectionManager{
Tracing: &envoyhttp.HttpConnectionManager_Tracing{
+ SpawnUpstreamSpan: &wrappers.BoolValue{Value: false},
CustomTags: []*envoytracing.CustomTag{
{
Tag: "header1",
@@ -150,6 +180,88 @@ var _ = Describe("Plugin", func() {
},
},
},
+ {
+ Tag: "envoy.metadata.foo",
+ Type: &envoytracing.CustomTag_Metadata_{
+ Metadata: &envoytracing.CustomTag_Metadata{
+ MetadataKey: &envoy_type_metadata_v3.MetadataKey{
+ Key: "namespace",
+ Path: []*envoy_type_metadata_v3.MetadataKey_PathSegment{
+ {
+ Segment: &envoy_type_metadata_v3.MetadataKey_PathSegment_Key{
+ Key: "nested",
+ },
+ },
+ {
+ Segment: &envoy_type_metadata_v3.MetadataKey_PathSegment_Key{
+ Key: "key",
+ },
+ },
+ },
+ },
+ Kind: &envoy_type_metadata_v3.MetadataKind{
+ Kind: &envoy_type_metadata_v3.MetadataKind_Request_{
+ Request: &envoy_type_metadata_v3.MetadataKind_Request{},
+ },
+ },
+ },
+ },
+ },
+ {
+ Tag: "envoy.metadata.bar",
+ Type: &envoytracing.CustomTag_Metadata_{
+ Metadata: &envoytracing.CustomTag_Metadata{
+ MetadataKey: &envoy_type_metadata_v3.MetadataKey{
+ Key: "namespace",
+ Path: []*envoy_type_metadata_v3.MetadataKey_PathSegment{
+ {
+ Segment: &envoy_type_metadata_v3.MetadataKey_PathSegment_Key{
+ Key: "nested",
+ },
+ },
+ {
+ Segment: &envoy_type_metadata_v3.MetadataKey_PathSegment_Key{
+ Key: "key",
+ },
+ },
+ },
+ },
+ Kind: &envoy_type_metadata_v3.MetadataKind{
+ Kind: &envoy_type_metadata_v3.MetadataKind_Host_{
+ Host: &envoy_type_metadata_v3.MetadataKind_Host{},
+ },
+ },
+ },
+ },
+ },
+ {
+ Tag: "envoy.metadata.baz",
+ Type: &envoytracing.CustomTag_Metadata_{
+ Metadata: &envoytracing.CustomTag_Metadata{
+ MetadataKey: &envoy_type_metadata_v3.MetadataKey{
+ Key: "namespace",
+ Path: []*envoy_type_metadata_v3.MetadataKey_PathSegment{
+ {
+ Segment: &envoy_type_metadata_v3.MetadataKey_PathSegment_Key{
+ Key: "nested",
+ },
+ },
+ {
+ Segment: &envoy_type_metadata_v3.MetadataKey_PathSegment_Key{
+ Key: "key",
+ },
+ },
+ },
+ },
+ DefaultValue: "default",
+ Kind: &envoy_type_metadata_v3.MetadataKind{
+ Kind: &envoy_type_metadata_v3.MetadataKind_Request_{
+ Request: &envoy_type_metadata_v3.MetadataKind_Request{},
+ },
+ },
+ },
+ },
+ },
},
ClientSampling: &envoy_type.Percent{Value: 10},
RandomSampling: &envoy_type.Percent{Value: 20},
@@ -171,11 +283,35 @@ var _ = Describe("Plugin", func() {
Expect(err).NotTo(HaveOccurred())
expected := &envoyhttp.HttpConnectionManager{
Tracing: &envoyhttp.HttpConnectionManager_Tracing{
- ClientSampling: &envoy_type.Percent{Value: 100},
- RandomSampling: &envoy_type.Percent{Value: 100},
- OverallSampling: &envoy_type.Percent{Value: 100},
- Verbose: false,
- Provider: nil,
+ ClientSampling: &envoy_type.Percent{Value: 100},
+ RandomSampling: &envoy_type.Percent{Value: 100},
+ OverallSampling: &envoy_type.Percent{Value: 100},
+ Verbose: false,
+ Provider: nil,
+ SpawnUpstreamSpan: &wrappers.BoolValue{Value: false},
+ },
+ }
+ Expect(cfg).To(Equal(expected))
+ })
+
+ It("should properly set spawn_upstream_span", func() {
+ cfg := &envoyhttp.HttpConnectionManager{}
+ hcmSettings = &hcm.HttpConnectionManagerSettings{
+ Tracing: &tracing.ListenerTracingSettings{
+ SpawnUpstreamSpan: true,
+ },
+ }
+
+ err := processHcmNetworkFilter(cfg)
+ Expect(err).NotTo(HaveOccurred())
+ expected := &envoyhttp.HttpConnectionManager{
+ Tracing: &envoyhttp.HttpConnectionManager_Tracing{
+ ClientSampling: &envoy_type.Percent{Value: 100},
+ RandomSampling: &envoy_type.Percent{Value: 100},
+ OverallSampling: &envoy_type.Percent{Value: 100},
+ Verbose: false,
+ Provider: nil,
+ SpawnUpstreamSpan: &wrappers.BoolValue{Value: true},
},
}
Expect(cfg).To(Equal(expected))
@@ -777,6 +913,47 @@ var _ = Describe("Plugin", func() {
Expect(cfg.Tracing.Provider.GetName()).To(Equal(expectedEnvoyTracingProvider.GetName()))
Expect(cfg.Tracing.Provider.GetTypedConfig()).To(Equal(expectedEnvoyTracingProvider.GetTypedConfig()))
})
+
+ It("can override the service_name", func() {
+ testClusterName := "test-cluster"
+ otelConfig := &envoytrace_gloo.OpenTelemetryConfig{
+ CollectorCluster: &envoytrace_gloo.OpenTelemetryConfig_ClusterName{
+ ClusterName: testClusterName,
+ },
+ ServiceName: "custom-service-name",
+ }
+
+ cfg := &envoyhttp.HttpConnectionManager{}
+ hcmSettings = &hcm.HttpConnectionManagerSettings{
+ Tracing: &tracing.ListenerTracingSettings{
+ ProviderConfig: &tracing.ListenerTracingSettings_OpenTelemetryConfig{
+ OpenTelemetryConfig: otelConfig,
+ },
+ },
+ }
+ err := processHcmNetworkFilter(cfg)
+ Expect(err).NotTo(HaveOccurred())
+
+ expectedEnvoyConfig := &envoytrace.OpenTelemetryConfig{
+ GrpcService: &envoy_config_core_v3.GrpcService{
+ TargetSpecifier: &envoy_config_core_v3.GrpcService_EnvoyGrpc_{
+ EnvoyGrpc: &envoy_config_core_v3.GrpcService_EnvoyGrpc{
+ ClusterName: testClusterName,
+ },
+ },
+ },
+ ServiceName: "custom-service-name",
+ }
+ expectedEnvoyConfigMarshalled, _ := ptypes.MarshalAny(expectedEnvoyConfig)
+ expectedEnvoyTracingProvider := &envoytrace.Tracing_Http{
+ Name: "envoy.tracers.opentelemetry",
+ ConfigType: &envoytrace.Tracing_Http_TypedConfig{
+ TypedConfig: expectedEnvoyConfigMarshalled,
+ },
+ }
+ Expect(cfg.Tracing.Provider.GetName()).To(Equal(expectedEnvoyTracingProvider.GetName()))
+ Expect(cfg.Tracing.Provider.GetTypedConfig()).To(Equal(expectedEnvoyTracingProvider.GetTypedConfig()))
+ })
})
})