-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from anunarapureddy/main
Section 5: Sampling content
- Loading branch information
Showing
4 changed files
with
192 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
apiVersion: opentelemetry.io/v1alpha1 | ||
kind: Instrumentation | ||
metadata: | ||
name: my-instrumentation | ||
namespace: tutorial-application | ||
spec: | ||
exporter: | ||
endpoint: http://otel-collector.observability-backend.svc.cluster.local:4317 | ||
propagators: | ||
- tracecontext | ||
- baggage | ||
- b3 | ||
sampler: | ||
type: parentbased_traceidratio | ||
argument: "0.5" | ||
resource: | ||
addK8sUIDAttributes: false | ||
python: | ||
env: | ||
# Required if endpoint is set to 4317. | ||
# Python autoinstrumentation uses http/proto by default | ||
# so data must be sent to 4318 instead of 4317. | ||
- name: OTEL_EXPORTER_OTLP_ENDPOINT | ||
value: http://otel-collector.observability-backend.svc.cluster.local:4318 | ||
java: | ||
env: | ||
- name: OTEL_LOGS_EXPORTER | ||
value: otlp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
apiVersion: opentelemetry.io/v1alpha1 | ||
kind: OpenTelemetryCollector | ||
metadata: | ||
name: otel | ||
namespace: observability-backend | ||
spec: | ||
image: ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:0.94.0 | ||
mode: deployment | ||
replicas: 1 | ||
ports: | ||
- port: 8888 | ||
protocol: TCP | ||
name: metrics | ||
config: | | ||
receivers: | ||
otlp: | ||
protocols: | ||
grpc: | ||
endpoint: 0.0.0.0:4317 | ||
http: | ||
endpoint: 0.0.0.0:4318 | ||
processors: | ||
# Sample 100% of traces with ERROR-ing spans (omit traces with all OK spans) | ||
# and traces which have a duration longer than 500ms | ||
tail_sampling: | ||
decision_wait: 10s # time to wait before making a sampling decision is made | ||
num_traces: 100 # number of traces to be kept in memory | ||
expected_new_traces_per_sec: 10 # expected rate of new traces per second | ||
policies: | ||
- name: keep-errors | ||
type: status_code | ||
status_code: {status_codes: [ERROR]} | ||
- name: keep-slow-traces | ||
type: latency | ||
latency: {threshold_ms: 500} | ||
exporters: | ||
debug: | ||
verbosity: detailed | ||
loadbalancing: | ||
protocol: | ||
otlp: | ||
timeout: 1s | ||
tls: | ||
insecure: true | ||
resolver: | ||
k8s: | ||
service: otel-gateway.observability-backend | ||
ports: | ||
- 4317 | ||
otlphttp/metrics: | ||
endpoint: http://prometheus.observability-backend.svc.cluster.local:80/api/v1/otlp/ | ||
tls: | ||
insecure: true | ||
debug: | ||
verbosity: detailed | ||
service: | ||
pipelines: | ||
traces: | ||
receivers: [otlp] | ||
processors: [tail_sampling] | ||
exporters: [otlp/traces] | ||
metrics: | ||
receivers: [otlp] | ||
exporters: [otlphttp/metrics] | ||
logs: | ||
receivers: [otlp] | ||
exporters: [debug] | ||
--- | ||
apiVersion: opentelemetry.io/v1alpha1 | ||
kind: OpenTelemetryCollector | ||
metadata: | ||
name: otel-gateway | ||
namespace: observability-backend | ||
spec: | ||
image: ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:0.94.0 | ||
mode: deployment | ||
replicas: 2 | ||
ports: | ||
- port: 8888 | ||
protocol: TCP | ||
name: metrics | ||
config: | | ||
receivers: | ||
otlp: | ||
protocols: | ||
grpc: | ||
endpoint: 0.0.0.0:4317 | ||
http: | ||
endpoint: 0.0.0.0:4318 | ||
processors: | ||
# Sample 100% of traces with ERROR-ing spans (omit traces with all OK spans) | ||
# and traces which have a duration longer than 500ms | ||
tail_sampling: | ||
decision_wait: 10s # time to wait before making a sampling decision is made | ||
num_traces: 100 # number of traces to be kept in memory | ||
expected_new_traces_per_sec: 10 # expected rate of new traces per second | ||
policies: | ||
- name: keep-errors | ||
type: status_code | ||
status_code: {status_codes: [ERROR]} | ||
- name: keep-slow-traces | ||
type: latency | ||
latency: {threshold_ms: 500} | ||
exporters: | ||
otlp/traces: | ||
endpoint: jaeger-collector:4317 | ||
tls: | ||
insecure: true | ||
otlphttp/metrics: | ||
endpoint: http://prometheus.observability-backend.svc.cluster.local:80/api/v1/otlp/ | ||
tls: | ||
insecure: true | ||
debug: | ||
verbosity: detailed | ||
service: | ||
pipelines: | ||
traces: | ||
receivers: [otlp] | ||
processors: [tail_sampling] | ||
exporters: [otlp/traces] | ||
metrics: | ||
receivers: [otlp] | ||
exporters: [otlphttp/metrics] | ||
logs: | ||
receivers: [otlp] | ||
exporters: [debug] | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters