Skip to content

Commit 51196b4

Browse files
api: Adding Zipkin Tracing support (#3630)
* api: Adding Zipkin Tracing support Signed-off-by: Alex Marston <[email protected]> * rollback /internal changes Signed-off-by: Alex Marston <[email protected]> * nest zipkin configuration under TracingProvider struct Signed-off-by: Alex Marston <[email protected]> * rollback internal testdata changes Signed-off-by: Alex Marston <[email protected]> * rollback site changes Signed-off-by: Alex Marston <[email protected]> * Change ZipkinConfiguration to a pointer. Co-authored-by: zirain <[email protected]> Signed-off-by: Alex Marston <[email protected]> * update deepcopy Signed-off-by: Alex Marston <[email protected]> * update description for TraceId128Bit field Signed-off-by: Alex Marston <[email protected]> * update site docs Signed-off-by: Alex Marston <[email protected]> * rename Zipkin config struct Signed-off-by: Alex Marston <[email protected]> * update api Signed-off-by: Alex Marston <[email protected]> * pointers for optional fields Signed-off-by: Alex Marston <[email protected]> * remove CollectorHostname Signed-off-by: Alex Marston <[email protected]> * TraceID128Bit -> Enable128BitTraceID Signed-off-by: Alex Marston <[email protected]> --------- Signed-off-by: Alex Marston <[email protected]> Signed-off-by: Alex Marston <[email protected]> Co-authored-by: zirain <[email protected]>
1 parent 9830c4d commit 51196b4

File tree

5 files changed

+105
-13
lines changed

5 files changed

+105
-13
lines changed

api/v1alpha1/tracing_types.go

+18-3
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,22 @@ type ProxyTracing struct {
1818
// If provider is kubernetes, pod name and namespace are added by default.
1919
CustomTags map[string]CustomTag `json:"customTags,omitempty"`
2020
// Provider defines the tracing provider.
21-
// Only OpenTelemetry is supported currently.
2221
Provider TracingProvider `json:"provider"`
2322
}
2423

2524
type TracingProviderType string
2625

2726
const (
2827
TracingProviderTypeOpenTelemetry TracingProviderType = "OpenTelemetry"
28+
TracingProviderTypeZipkin TracingProviderType = "Zipkin"
2929
)
3030

3131
// TracingProvider defines the tracing provider configuration.
3232
//
3333
// +kubebuilder:validation:XValidation:message="host or backendRefs needs to be set",rule="has(self.host) || self.backendRefs.size() > 0"
3434
type TracingProvider struct {
3535
// Type defines the tracing provider type.
36-
// EG currently only supports OpenTelemetry.
37-
// +kubebuilder:validation:Enum=OpenTelemetry
36+
// +kubebuilder:validation:Enum=OpenTelemetry;Zipkin
3837
// +kubebuilder:default=OpenTelemetry
3938
Type TracingProviderType `json:"type"`
4039
// Host define the provider service hostname.
@@ -58,6 +57,9 @@ type TracingProvider struct {
5857
// +kubebuilder:validation:XValidation:message="only support Service kind.",rule="self.all(f, f.kind == 'Service')"
5958
// +kubebuilder:validation:XValidation:message="BackendRefs only supports Core group.",rule="self.all(f, f.group == '')"
6059
BackendRefs []BackendRef `json:"backendRefs,omitempty"`
60+
// Zipkin defines the Zipkin tracing provider configuration
61+
// +optional
62+
Zipkin *ZipkinTracingProvider `json:"zipkin,omitempty"`
6163
}
6264

6365
type CustomTagType string
@@ -114,3 +116,16 @@ type RequestHeaderCustomTag struct {
114116
// +optional
115117
DefaultValue *string `json:"defaultValue,omitempty"`
116118
}
119+
120+
// ZipkinTracingProvider defines the Zipkin tracing provider configuration.
121+
type ZipkinTracingProvider struct {
122+
// Enable128BitTraceID determines whether a 128bit trace id will be used
123+
// when creating a new trace instance. If set to false, a 64bit trace
124+
// id will be used.
125+
// +optional
126+
Enable128BitTraceID *bool `json:"enable128BitTraceId,omitempty"`
127+
// DisableSharedSpanContext determines whether the default Envoy behaviour of
128+
// client and server spans sharing the same span context should be disabled.
129+
// +optional
130+
DisableSharedSpanContext *bool `json:"disableSharedSpanContext,omitempty"`
131+
}

api/v1alpha1/zz_generated.deepcopy.go

+30
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

charts/gateway-helm/crds/generated/gateway.envoyproxy.io_envoyproxies.yaml

+19-6
Original file line numberDiff line numberDiff line change
@@ -10864,9 +10864,7 @@ spec:
1086410864
If provider is kubernetes, pod name and namespace are added by default.
1086510865
type: object
1086610866
provider:
10867-
description: |-
10868-
Provider defines the tracing provider.
10869-
Only OpenTelemetry is supported currently.
10867+
description: Provider defines the tracing provider.
1087010868
properties:
1087110869
backendRefs:
1087210870
description: |-
@@ -10972,12 +10970,27 @@ spec:
1097210970
type: integer
1097310971
type:
1097410972
default: OpenTelemetry
10975-
description: |-
10976-
Type defines the tracing provider type.
10977-
EG currently only supports OpenTelemetry.
10973+
description: Type defines the tracing provider type.
1097810974
enum:
1097910975
- OpenTelemetry
10976+
- Zipkin
1098010977
type: string
10978+
zipkin:
10979+
description: Zipkin defines the Zipkin tracing provider
10980+
configuration
10981+
properties:
10982+
disableSharedSpanContext:
10983+
description: |-
10984+
DisableSharedSpanContext determines whether the default Envoy behaviour of
10985+
client and server spans sharing the same span context should be disabled.
10986+
type: boolean
10987+
enable128BitTraceId:
10988+
description: |-
10989+
Enable128BitTraceID determines whether a 128bit trace id will be used
10990+
when creating a new trace instance. If set to false, a 64bit trace
10991+
id will be used.
10992+
type: boolean
10993+
type: object
1098110994
required:
1098210995
- type
1098310996
type: object

site/content/en/latest/api/extension_types.md

+19-2
Original file line numberDiff line numberDiff line change
@@ -2910,7 +2910,7 @@ _Appears in:_
29102910
| --- | --- | --- | --- |
29112911
| `samplingRate` | _integer_ | false | SamplingRate controls the rate at which traffic will be<br />selected for tracing if no prior sampling decision has been made.<br />Defaults to 100, valid values [0-100]. 100 indicates 100% sampling. |
29122912
| `customTags` | _object (keys:string, values:[CustomTag](#customtag))_ | true | CustomTags defines the custom tags to add to each span.<br />If provider is kubernetes, pod name and namespace are added by default. |
2913-
| `provider` | _[TracingProvider](#tracingprovider)_ | true | Provider defines the tracing provider.<br />Only OpenTelemetry is supported currently. |
2913+
| `provider` | _[TracingProvider](#tracingprovider)_ | true | Provider defines the tracing provider. |
29142914

29152915

29162916
#### RateLimit
@@ -3564,10 +3564,11 @@ _Appears in:_
35643564

35653565
| Field | Type | Required | Description |
35663566
| --- | --- | --- | --- |
3567-
| `type` | _[TracingProviderType](#tracingprovidertype)_ | true | Type defines the tracing provider type.<br />EG currently only supports OpenTelemetry. |
3567+
| `type` | _[TracingProviderType](#tracingprovidertype)_ | true | Type defines the tracing provider type. |
35683568
| `host` | _string_ | false | Host define the provider service hostname.<br />Deprecated: Use BackendRefs instead. |
35693569
| `port` | _integer_ | false | Port defines the port the provider service is exposed on.<br />Deprecated: Use BackendRefs instead. |
35703570
| `backendRefs` | _[BackendRef](#backendref) array_ | false | BackendRefs references a Kubernetes object that represents the<br />backend server to which the trace will be sent.<br />Only Service kind is supported for now. |
3571+
| `zipkin` | _[ZipkinTracingProvider](#zipkintracingprovider)_ | false | Zipkin defines the Zipkin tracing provider configuration |
35713572

35723573

35733574
#### TracingProviderType
@@ -3583,6 +3584,7 @@ _Appears in:_
35833584
| ----- | ----------- |
35843585
| `OpenTelemetry` | |
35853586
| `OpenTelemetry` | |
3587+
| `Zipkin` | |
35863588

35873589

35883590
#### TriggerEnum
@@ -3795,3 +3797,18 @@ _Appears in:_
37953797
| `numTrustedHops` | _integer_ | false | NumTrustedHops controls the number of additional ingress proxy hops from the right side of XFF HTTP<br />headers to trust when determining the origin client's IP address.<br />Refer to https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_conn_man/headers#x-forwarded-for<br />for more details. |
37963798

37973799

3800+
#### ZipkinTracingProvider
3801+
3802+
3803+
3804+
ZipkinTracingProvider defines the Zipkin tracing provider configuration.
3805+
3806+
_Appears in:_
3807+
- [TracingProvider](#tracingprovider)
3808+
3809+
| Field | Type | Required | Description |
3810+
| --- | --- | --- | --- |
3811+
| `enable128BitTraceId` | _boolean_ | false | Enable128BitTraceID determines whether a 128bit trace id will be used<br />when creating a new trace instance. If set to false, a 64bit trace<br />id will be used. |
3812+
| `disableSharedSpanContext` | _boolean_ | false | DisableSharedSpanContext determines whether the default Envoy behaviour of<br />client and server spans sharing the same span context should be disabled. |
3813+
3814+

site/content/zh/latest/api/extension_types.md

+19-2
Original file line numberDiff line numberDiff line change
@@ -2910,7 +2910,7 @@ _Appears in:_
29102910
| --- | --- | --- | --- |
29112911
| `samplingRate` | _integer_ | false | SamplingRate controls the rate at which traffic will be<br />selected for tracing if no prior sampling decision has been made.<br />Defaults to 100, valid values [0-100]. 100 indicates 100% sampling. |
29122912
| `customTags` | _object (keys:string, values:[CustomTag](#customtag))_ | true | CustomTags defines the custom tags to add to each span.<br />If provider is kubernetes, pod name and namespace are added by default. |
2913-
| `provider` | _[TracingProvider](#tracingprovider)_ | true | Provider defines the tracing provider.<br />Only OpenTelemetry is supported currently. |
2913+
| `provider` | _[TracingProvider](#tracingprovider)_ | true | Provider defines the tracing provider. |
29142914

29152915

29162916
#### RateLimit
@@ -3564,10 +3564,11 @@ _Appears in:_
35643564

35653565
| Field | Type | Required | Description |
35663566
| --- | --- | --- | --- |
3567-
| `type` | _[TracingProviderType](#tracingprovidertype)_ | true | Type defines the tracing provider type.<br />EG currently only supports OpenTelemetry. |
3567+
| `type` | _[TracingProviderType](#tracingprovidertype)_ | true | Type defines the tracing provider type. |
35683568
| `host` | _string_ | false | Host define the provider service hostname.<br />Deprecated: Use BackendRefs instead. |
35693569
| `port` | _integer_ | false | Port defines the port the provider service is exposed on.<br />Deprecated: Use BackendRefs instead. |
35703570
| `backendRefs` | _[BackendRef](#backendref) array_ | false | BackendRefs references a Kubernetes object that represents the<br />backend server to which the trace will be sent.<br />Only Service kind is supported for now. |
3571+
| `zipkin` | _[ZipkinTracingProvider](#zipkintracingprovider)_ | false | Zipkin defines the Zipkin tracing provider configuration |
35713572

35723573

35733574
#### TracingProviderType
@@ -3583,6 +3584,7 @@ _Appears in:_
35833584
| ----- | ----------- |
35843585
| `OpenTelemetry` | |
35853586
| `OpenTelemetry` | |
3587+
| `Zipkin` | |
35863588

35873589

35883590
#### TriggerEnum
@@ -3795,3 +3797,18 @@ _Appears in:_
37953797
| `numTrustedHops` | _integer_ | false | NumTrustedHops controls the number of additional ingress proxy hops from the right side of XFF HTTP<br />headers to trust when determining the origin client's IP address.<br />Refer to https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_conn_man/headers#x-forwarded-for<br />for more details. |
37963798

37973799

3800+
#### ZipkinTracingProvider
3801+
3802+
3803+
3804+
ZipkinTracingProvider defines the Zipkin tracing provider configuration.
3805+
3806+
_Appears in:_
3807+
- [TracingProvider](#tracingprovider)
3808+
3809+
| Field | Type | Required | Description |
3810+
| --- | --- | --- | --- |
3811+
| `enable128BitTraceId` | _boolean_ | false | Enable128BitTraceID determines whether a 128bit trace id will be used<br />when creating a new trace instance. If set to false, a 64bit trace<br />id will be used. |
3812+
| `disableSharedSpanContext` | _boolean_ | false | DisableSharedSpanContext determines whether the default Envoy behaviour of<br />client and server spans sharing the same span context should be disabled. |
3813+
3814+

0 commit comments

Comments
 (0)