Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: fix tracing doc and example #1741

Merged
merged 3 commits into from
Aug 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 23 additions & 7 deletions docs/latest/design/tracing.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ Only OpenTelemetry sink can be configured currently, you can use [OpenTelemetry
type ProxyTracing struct {
// SamplingRate controls the rate at which traffic will be
// selected for tracing if no prior sampling decision has been made.
// Defaults to 0, valid values [0-100]. 100 indicates 100% sampling.
// Defaults to 100, valid values [0-100]. 100 indicates 100% sampling.
// +kubebuilder:validation:Minimum=0
// +kubebuilder:validation:Maximum=100
// +kubebuilder:default=100
// +optional
SamplingRate *uint32 `json:"samplingRate,omitempty"`
// CustomTags defines the custom tags to add to each span.
Expand All @@ -41,7 +42,18 @@ type ProxyTracing struct {
Provider TracingProvider `json:"provider"`
}

type TracingProviderType string

const (
TracingProviderTypeOpenTelemetry TracingProviderType = "OpenTelemetry"
)

type TracingProvider struct {
// Type defines the tracing provider type.
// EG currently only supports OpenTelemetry.
// +kubebuilder:validation:Enum=OpenTelemetry
// +kubebuilder:default=OpenTelemetry
Type TracingProviderType `json:"type"`
// Host define the provider service hostname.
Host string `json:"host"`
// Port defines the port the provider service is exposed on.
Expand Down Expand Up @@ -120,24 +132,28 @@ metadata:
namespace: envoy-gateway-system
spec:
telemetry:
samplingRate: 100 # sample 100% of requests
tracing:
# sample 100% of requests
samplingRate: 100
provider:
host: otel-collector.monitoring.svc.cluster.local
port: 4317
customTags:
key1: # This is an example of using a literal as a tag value
# This is an example of using a literal as a tag value
key1:
type: Literal
literal:
value: "val1"
env1: # This is an example of using an environment variable as a tag value
# This is an example of using an environment variable as a tag value
env1:
type: Environment
environment:
name: ENV1
defaultValue: "-"
header1: # This is an example of using a header value as a tag value
type: Header
header:
# This is an example of using a header value as a tag value
header1:
type: RequestHeader
requestHeader:
name: X-Header-1
defaultValue: "-"
```
8 changes: 4 additions & 4 deletions examples/kubernetes/tracing/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ metadata:
namespace: envoy-gateway-system
spec:
telemetry:
# sample 100% of requests
samplingRate: 100
tracing:
# sample 100% of requests
samplingRate: 100
provider:
host: otel-collector.monitoring.svc.cluster.local
port: 4317
Expand All @@ -37,7 +37,7 @@ spec:
defaultValue: "-"
# This is an example of using a header value as a tag value
header1:
type: Header
header:
type: RequestHeader
requestHeader:
name: X-Header-1
defaultValue: "-"