-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add instrumentation examples (#3680)
- Loading branch information
1 parent
053e55b
commit 1c2d05c
Showing
2 changed files
with
152 additions
and
0 deletions.
There are no files selected for viewing
71 changes: 71 additions & 0 deletions
71
examples/instrumentation/custom-values-cascading-filter.yaml
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,71 @@ | ||
sumologic: | ||
accessId: <ENTER_YOUR_SUMOLOGIC_ACCESS_ID> | ||
accessKey: <ENTER_YOUR_SUMOLOGIC_ACCESS_KEY> | ||
clusterName: <ENTER_YOUR_CLUSTER_NAME> | ||
traces: | ||
enabled: true | ||
## Following configures OpenTelemetry Collector (traces-sampler) | ||
tracesSampler: | ||
config: | ||
processors: | ||
## Following enables a smart cascading filtering rules with preset limits. | ||
## https://github.com/SumoLogic/sumologic-otel-collector/tree/main/pkg/processor/cascadingfilterprocessor | ||
cascading_filter: | ||
## (default = 30s): Wait time since the first span of a trace before making | ||
## a filtering decision | ||
decision_wait: 30s | ||
## (default = 100000): Number of traces kept in memory | ||
num_traces: 200000 | ||
## (default = 0): Expected number of new traces (helps in allocating data structures) | ||
expected_new_traces_per_sec: 100 | ||
## (default = 0): defines maximum number of spans per second | ||
spans_per_second: 1600 | ||
## Number of spans that are always probabilistically filtered | ||
## (hence might be used for metrics calculation). | ||
probabilistic_filtering_rate: 100 | ||
## Rules that will reject all traces matching them | ||
trace_reject_filters: | ||
# Adjust or remove the example as needed | ||
- name: remove-all-traces-with-health-span | ||
name_pattern: "health.*" | ||
# Adjust or remove the example as needed | ||
- name: remove-all-traces-with-healthcheck-service | ||
attributes: | ||
- key: service.name | ||
values: | ||
- "healthcheck/.*" | ||
use_regex: true | ||
## Rules that will accept traces with this criteria, but only to a given volume | ||
trace_accept_filters: | ||
# Adjust or remove the example as needed | ||
- name: sampling-priority, | ||
attributes: | ||
- key: sampling.priority | ||
values: | ||
- "1" | ||
spans_per_second: 400 # <- adjust the output traffic level | ||
# Adjust or remove the example as needed | ||
- name: traces-with-errors | ||
properties: | ||
min_number_of_errors: 1 | ||
spans_per_second: 400 # <- adjust the output traffic level | ||
# Adjust or remove the example as needed | ||
- name: traces-with-and-high-latency | ||
properties: | ||
min_duration: 10s | ||
spans_per_second: 800 # <- adjust the output traffic level | ||
# Adjust or remove the example as needed | ||
# - name: some-service-traces-with-some-attribute | ||
# attributes: | ||
# - key: service.name | ||
# values: | ||
# - some-service | ||
# - key: important-key | ||
# values: | ||
# - value1 | ||
# - value2 | ||
# use_regex: true | ||
# spans_per_second: 300 # <- adjust the output traffic level | ||
# Adjust or remove the example as needed | ||
- name: everything_else | ||
spans_per_second: -1 # If there's anything left in the budget, it will randomly select remaining traces |
81 changes: 81 additions & 0 deletions
81
examples/instrumentation/multiple-cascading-filter-sampler-instances.yaml
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,81 @@ | ||
sumologic: | ||
accessId: <ENTER_YOUR_SUMOLOGIC_ACCESS_ID> | ||
accessKey: <ENTER_YOUR_SUMOLOGIC_ACCESS_KEY> | ||
clusterName: <ENTER_YOUR_CLUSTER_NAME> | ||
traces: | ||
enabled: true | ||
## Following configures OpenTelemetry Collector (traces-sampler) | ||
tracesSampler: | ||
## In case of multiple pods sharing single configuration map of the cascadingfilter, | ||
## environment variable called SUMO_COLLECTOR_INSTANCES should be used to scale down properly | ||
## spans_per_second global and policy limits. SUMO_COLLECTOR_INSTANCES should be positive integer | ||
## corresponding to the number of collectors with configured cascadingfilters e.g. SUMO_COLLECTOR_INSTANCES=5. | ||
## As a result configured spans_per_second limit will be divided by 5 for global and policy limits. | ||
deployment: | ||
replicas: 5 # Number of traces-sampler (cascading_filter) pods | ||
extraEnvVars: | ||
- name: SUMO_COLLECTOR_INSTANCES | ||
value: "5" # Number of traces-sampler (cascading_filter) pods | ||
config: | ||
processors: | ||
## Following enables a smart cascading filtering rules with preset limits. | ||
## https://github.com/SumoLogic/sumologic-otel-collector/tree/main/pkg/processor/cascadingfilterprocessor | ||
cascading_filter: | ||
## (default = 30s): Wait time since the first span of a trace before making | ||
## a filtering decision | ||
decision_wait: 30s | ||
## (default = 100000): Number of traces kept in memory | ||
num_traces: 200000 | ||
## (default = 0): Expected number of new traces (helps in allocating data structures) | ||
expected_new_traces_per_sec: 100 | ||
## (default = 0): defines maximum number of spans per second | ||
spans_per_second: 1600 | ||
## Number of spans that are always probabilistically filtered | ||
## (hence might be used for metrics calculation). | ||
probabilistic_filtering_rate: 100 | ||
## Rules that will reject all traces matching them | ||
trace_reject_filters: | ||
# Adjust or remove the example as needed | ||
- name: remove-all-traces-with-health-span | ||
name_pattern: "health.*" | ||
# Adjust or remove the example as needed | ||
- name: remove-all-traces-with-healthcheck-service | ||
attributes: | ||
- key: service.name | ||
values: | ||
- "healthcheck/.*" | ||
use_regex: true | ||
## Rules that will accept traces with this criteria, but only to a given volume | ||
trace_accept_filters: | ||
# Adjust or remove the example as needed | ||
- name: sampling-priority, | ||
attributes: | ||
- key: sampling.priority | ||
values: | ||
- "1" | ||
spans_per_second: 400 # <- adjust the output traffic level | ||
# Adjust or remove the example as needed | ||
- name: traces-with-errors | ||
properties: | ||
min_number_of_errors: 1 | ||
spans_per_second: 400 # <- adjust the output traffic level | ||
# Adjust or remove the example as needed | ||
- name: traces-with-and-high-latency | ||
properties: | ||
min_duration: 10s | ||
spans_per_second: 800 # <- adjust the output traffic level | ||
# Adjust or remove the example as needed | ||
# - name: some-service-traces-with-some-attribute | ||
# attributes: | ||
# - key: service.name | ||
# values: | ||
# - some-service | ||
# - key: important-key | ||
# values: | ||
# - value1 | ||
# - value2 | ||
# use_regex: true | ||
# spans_per_second: 300 # <- adjust the output traffic level | ||
# Adjust or remove the example as needed | ||
- name: everything_else | ||
spans_per_second: -1 # If there's anything left in the budget, it will randomly select remaining traces |