Skip to content

Commit 3642f76

Browse files
Anusha NarapureddyAnusha Narapureddy
authored andcommitted
add otel lb collector yaml
1 parent 1ec7755 commit 3642f76

3 files changed

Lines changed: 74 additions & 63 deletions

File tree

05-sampling.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,4 +101,13 @@ Requires two deployments of the Collector, the first layer routing all the spans
101101

102102
[excalidraw](https://excalidraw.com/#room=6a15d65ba4615c535a40,xcZD6DG977owHRoxpYY4Ag)
103103

104+
Apply the YAML below to deploy a layer of Collectors containing the load-balancing exporter in front of collectors performing tail-sampling:
105+
106+
```shell
107+
kubectl apply -f https://raw.githubusercontent.com/pavolloffay/kubecon-eu-2024-opentelemetry-kubernetes-tracing-tutorial/backend/05-scale-otel-collectors.yaml
108+
kubectl get pods -n observability-backend -w
109+
```
110+
111+
<TODO: Add screenshot>
112+
104113
[Next steps](./06-RED-metrics.md)

backend/05-gateway-collector.yaml

Lines changed: 0 additions & 63 deletions
This file was deleted.
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,68 @@ spec:
7070
logs:
7171
receivers: [otlp]
7272
exporters: [debug]
73+
---
74+
apiVersion: opentelemetry.io/v1alpha1
75+
kind: OpenTelemetryCollector
76+
metadata:
77+
name: otel-gateway
78+
namespace: observability-backend
79+
spec:
80+
image: ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:0.94.0
81+
mode: deployment
82+
replicas: 2
83+
ports:
84+
- port: 8888
85+
protocol: TCP
86+
name: metrics
87+
config: |
88+
receivers:
89+
otlp:
90+
protocols:
91+
grpc:
92+
endpoint: 0.0.0.0:4317
93+
http:
94+
endpoint: 0.0.0.0:4318
95+
96+
processors:
97+
# Sample 100% of traces with ERROR-ing spans (omit traces with all OK spans)
98+
# and traces which have a duration longer than 500ms
99+
tail_sampling:
100+
decision_wait: 10s # time to wait before making a sampling decision is made
101+
num_traces: 100 # number of traces to be kept in memory
102+
expected_new_traces_per_sec: 10 # expected rate of new traces per second
103+
policies:
104+
- name: keep-errors
105+
type: status_code
106+
status_code: {status_codes: [ERROR]}
107+
- name: keep-slow-traces
108+
type: latency
109+
latency: {threshold_ms: 500}
110+
111+
exporters:
112+
otlp/traces:
113+
endpoint: jaeger-collector:4317
114+
tls:
115+
insecure: true
116+
117+
otlphttp/metrics:
118+
endpoint: http://prometheus.observability-backend.svc.cluster.local:80/api/v1/otlp/
119+
tls:
120+
insecure: true
121+
122+
debug:
123+
verbosity: detailed
124+
125+
service:
126+
pipelines:
127+
traces:
128+
receivers: [otlp]
129+
processors: [tail_sampling]
130+
exporters: [otlp/traces]
131+
metrics:
132+
receivers: [otlp]
133+
exporters: [otlphttp/metrics]
134+
logs:
135+
receivers: [otlp]
136+
exporters: [debug]
137+
---

0 commit comments

Comments
 (0)