Skip to content

Commit aab6d3e

Browse files
zirainXunzhuo
andauthored
docs: fix tracing doc and example (envoyproxy#1741)
Signed-off-by: zirain <zirain2009@gmail.com> Co-authored-by: Xunzhuo <bitliu@tencent.com>
1 parent a7784c5 commit aab6d3e

2 files changed

Lines changed: 27 additions & 11 deletions

File tree

docs/latest/design/tracing.md

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@ Only OpenTelemetry sink can be configured currently, you can use [OpenTelemetry
2828
type ProxyTracing struct {
2929
// SamplingRate controls the rate at which traffic will be
3030
// selected for tracing if no prior sampling decision has been made.
31-
// Defaults to 0, valid values [0-100]. 100 indicates 100% sampling.
31+
// Defaults to 100, valid values [0-100]. 100 indicates 100% sampling.
3232
// +kubebuilder:validation:Minimum=0
3333
// +kubebuilder:validation:Maximum=100
34+
// +kubebuilder:default=100
3435
// +optional
3536
SamplingRate *uint32 `json:"samplingRate,omitempty"`
3637
// CustomTags defines the custom tags to add to each span.
@@ -41,7 +42,18 @@ type ProxyTracing struct {
4142
Provider TracingProvider `json:"provider"`
4243
}
4344

45+
type TracingProviderType string
46+
47+
const (
48+
TracingProviderTypeOpenTelemetry TracingProviderType = "OpenTelemetry"
49+
)
50+
4451
type TracingProvider struct {
52+
// Type defines the tracing provider type.
53+
// EG currently only supports OpenTelemetry.
54+
// +kubebuilder:validation:Enum=OpenTelemetry
55+
// +kubebuilder:default=OpenTelemetry
56+
Type TracingProviderType `json:"type"`
4557
// Host define the provider service hostname.
4658
Host string `json:"host"`
4759
// Port defines the port the provider service is exposed on.
@@ -120,24 +132,28 @@ metadata:
120132
namespace: envoy-gateway-system
121133
spec:
122134
telemetry:
123-
samplingRate: 100 # sample 100% of requests
124135
tracing:
136+
# sample 100% of requests
137+
samplingRate: 100
125138
provider:
126139
host: otel-collector.monitoring.svc.cluster.local
127140
port: 4317
128141
customTags:
129-
key1: # This is an example of using a literal as a tag value
142+
# This is an example of using a literal as a tag value
143+
key1:
130144
type: Literal
131145
literal:
132146
value: "val1"
133-
env1: # This is an example of using an environment variable as a tag value
147+
# This is an example of using an environment variable as a tag value
148+
env1:
134149
type: Environment
135150
environment:
136151
name: ENV1
137152
defaultValue: "-"
138-
header1: # This is an example of using a header value as a tag value
139-
type: Header
140-
header:
153+
# This is an example of using a header value as a tag value
154+
header1:
155+
type: RequestHeader
156+
requestHeader:
141157
name: X-Header-1
142158
defaultValue: "-"
143159
```

examples/kubernetes/tracing/default.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ metadata:
1717
namespace: envoy-gateway-system
1818
spec:
1919
telemetry:
20-
# sample 100% of requests
21-
samplingRate: 100
2220
tracing:
21+
# sample 100% of requests
22+
samplingRate: 100
2323
provider:
2424
host: otel-collector.monitoring.svc.cluster.local
2525
port: 4317
@@ -37,7 +37,7 @@ spec:
3737
defaultValue: "-"
3838
# This is an example of using a header value as a tag value
3939
header1:
40-
type: Header
41-
header:
40+
type: RequestHeader
41+
requestHeader:
4242
name: X-Header-1
4343
defaultValue: "-"

0 commit comments

Comments
 (0)