Skip to content

Commit f20e406

Browse files
authored
Add Sumo examples (#681)
1 parent 14c7015 commit f20e406

File tree

6 files changed

+370
-0
lines changed

6 files changed

+370
-0
lines changed

examples/README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Examples
2+
## Kubernetes configuration
3+
4+
### Helm chart values template
5+
[kubernetes/custom-values.yaml](./kubernetes/custom-values.yaml) contains
6+
an example template for Sumologic Kubernetes Collection Helm chart, which
7+
installs OpenTelemetry Collector in Agent and Gateway configuration, as described
8+
in the [documentation](https://help.sumologic.com/Traces/Getting_Started_with_Transaction_Tracing/Set_up_traces_collection_for_Kubernetes_environments).
9+
10+
After filling the template values, you can install it following
11+
[Sumologic Kubernetes Collection installation instructions](https://github.com/SumoLogic/sumologic-kubernetes-collection/blob/release-v2.0/deploy/docs/Installation_with_Helm.md)
12+
For example, by running following commands:
13+
```shell
14+
helm repo add sumologic https://sumologic.github.io/sumologic-kubernetes-collection
15+
kubectl create namespace sumologic
16+
helm upgrade --install my-release -n sumologic sumologic/sumologic -f custom-values.yaml
17+
```
18+
19+
### Helm chart values template with cascading filter enabled
20+
21+
Additionally, [kubernetes/custom-values-cascading-filter.yaml](./kubernetes/custom-values-cascading-filter.yaml)
22+
includes an alternative example template that enables cascading filter,
23+
as described in [trace filtering documentation](https://help.sumologic.com/Traces/Getting_Started_with_Transaction_Tracing/What_if_I_don't_want_to_send_all_the_tracing_data_to_Sumo_Logic%3F).
24+
Note that cascading filter is currently supported only for single-instance
25+
OpenTelemetry Collector deployments.
26+
27+
## Non-kubernetes configuration
28+
29+
### Agent configuration (should be run on each host/node)
30+
[non-kubernetes/agent-configuration-template.yaml](non-kubernetes/agent-configuration-template.yaml) contains
31+
an OpenTelemetry Collector YAML file which includes configuration
32+
for OpenTelemetry Collector running in Agent mode. It should be
33+
deployed on each host/node within the system.
34+
35+
### Gateway configuration (should be run per each cluster/data-center/etc.)
36+
[non-kubernetes/gateway-configuration-template.yaml](non-kubernetes/gateway-configuration-template.yaml) contains
37+
an OpenTelemetry Collector YAML file which includes configuration
38+
for OpenTelemetry Collector running in Gateway mode.
39+
40+
Additionally, for [non-kubernetes/gateway-configuration-template-with-cascading-filter.yaml](non-kubernetes/gateway-configuration-template-with-cascading-filter.yaml)
41+
the configuration also includes cascading filter config,
42+
which is described in more detail in [trace filtering documentation](https://help.sumologic.com/Traces/Getting_Started_with_Transaction_Tracing/What_if_I_don't_want_to_send_all_the_tracing_data_to_Sumo_Logic%3F).
43+
44+
Please refer to [relevant documentation](https://help.sumologic.com/Traces/Getting_Started_with_Transaction_Tracing/Set_up_traces_collection_for_other_environments)
45+
for more details.
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
sumologic:
2+
accessId: <ENTER_YOUR_SUMOLOGIC_ACCESS_ID>
3+
accessKey: <ENTER_YOUR_SUMOLOGIC_ACCESS_KEY>
4+
clusterName: <ENTER_YOUR_CLUSTER_NAME>
5+
traces:
6+
enabled: true
7+
## Following enables OpenTelemetry Agent which runs on each node as a DaemonSet
8+
otelagent:
9+
enabled:
10+
true
11+
## Following configures OpenTelemetry Collector (gateway)
12+
## Note that if cascading_filter is used, deployment must include only a single instance
13+
otelcol:
14+
metrics:
15+
## This enables exposing OpenTelemetry Collector metrics. Note that they will consume your DPM
16+
## hence by default they are disabled
17+
enabled:
18+
true
19+
config:
20+
processors:
21+
## Following enables a smart cascading filtering rules with preset limits.
22+
cascading_filter:
23+
## (default = 30s): Wait time since the first span of a trace before making
24+
## a filtering decision
25+
decision_wait: 30s
26+
## (default = 50000): Number of traces kept in memory
27+
num_traces: 50000
28+
## (default = 0): Expected number of new traces (helps in allocating data structures)
29+
expected_new_traces_per_sec: 100
30+
## (default = 0): defines maximum number of spans per second
31+
spans_per_second: 1600
32+
## (default = 0.2): Ratio of spans that are always probabilistically filtered
33+
## (hence might be used for metrics calculation).
34+
probabilistic_filtering_ratio: 0.2
35+
## (no default): Policies used to make a sampling decision
36+
policies:
37+
- name: sampling-priority,
38+
## string_attribute: allows to specify conditions that need to be met
39+
string_attribute: {
40+
key: sampling.priority, values: [ "1" ]
41+
},
42+
## Spans_per_second: max number of emitted spans per second by this policy.
43+
spans_per_second: 500
44+
- name: everything-else
45+
## This selects all traces, up the to the global limit
46+
spans_per_second: -1
47+
## Following are some examples of other rules that could be used
48+
# - name: extended-duration
49+
# ## Spans_per_second: max number of emitted spans per second by this policy.
50+
# spans_per_second: 500
51+
# properties:
52+
# ## Selects the span if the duration is greater or equal the given
53+
# ## value (use s or ms as the suffix to indicate unit).
54+
# min_duration: 5s
55+
# - name: "status_code_condition",
56+
# ## Spans_per_second: max number of emitted spans per second by this policy.
57+
# spans_per_second: 500,
58+
# ## numeric_attribute: provides a list of conditions that need to be met
59+
# numeric_attribute: {
60+
# key: "http.status_code", min_value: 400, max_value: 999
61+
# }
62+
# - name: everything-that-is-not-healthcheck
63+
# ## This selects all traces where there is NO span starting with `health` operation name
64+
# ## If employed, "everything-else" rule must be replaced with it
65+
# properties:
66+
# name_pattern: "^(healthcheck|otherhealthcheck).*"
67+
# invert_match: true
68+
# spans_per_second: -1
69+
service:
70+
pipelines:
71+
traces:
72+
## This is required to enable cascading_filter
73+
processors: [memory_limiter, k8s_tagger, source, resource, cascading_filter, batch]
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
sumologic:
2+
accessId: <ENTER_YOUR_SUMOLOGIC_ACCESS_ID>
3+
accessKey: <ENTER_YOUR_SUMOLOGIC_ACCESS_KEY>
4+
clusterName: <ENTER_YOUR_CLUSTER_NAME>
5+
traces:
6+
enabled: true
7+
otelcol:
8+
## This enables exposing OpenTelemetry Collector metrics. Note that they will consume your DPM
9+
## hence by default they are disabled
10+
metrics:
11+
enabled:
12+
true
13+
## Following enables OpenTelemetry Agent which runs on each node as a DaemonSet
14+
otelagent:
15+
enabled:
16+
true
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
receivers:
2+
jaeger:
3+
protocols:
4+
thrift_compact:
5+
endpoint: "0.0.0.0:6831"
6+
thrift_binary:
7+
endpoint: "0.0.0.0:6832"
8+
grpc:
9+
endpoint: "0.0.0.0:14250"
10+
thrift_http:
11+
endpoint: "0.0.0.0:14268"
12+
opencensus:
13+
endpoint: "0.0.0.0:55678"
14+
otlp:
15+
protocols:
16+
grpc:
17+
endpoint: "0.0.0.0:4317"
18+
http:
19+
endpoint: "0.0.0.0:55681"
20+
zipkin:
21+
endpoint: "0.0.0.0:9411"
22+
processors:
23+
## The memory_limiter processor is used to prevent out of memory situations on the collector.
24+
memory_limiter:
25+
## check_interval is the time between measurements of memory usage for the
26+
## purposes of avoiding going over the limits. Defaults to zero, so no
27+
## checks will be performed. Values below 1 second are not recommended since
28+
## it can result in unnecessary CPU consumption.
29+
check_interval: 5s
30+
31+
## Maximum amount of memory, in MiB, targeted to be allocated by the process heap.
32+
## Note that typically the total memory usage of process will be about 50MiB higher
33+
## than this value.
34+
limit_mib: 500
35+
36+
## Please enable/disable accordingly if on AWS, GCE, ECS, elastic_beanstalk or neither
37+
resourcedetection:
38+
detectors: [ ec2, gce, ecs, elastic_beanstalk ]
39+
timeout: 5s
40+
override: false
41+
42+
## The batch processor accepts spans and places them into batches grouped by node and resource
43+
batch:
44+
## Number of spans after which a batch will be sent regardless of time
45+
send_batch_size: 256
46+
## Never more than this many spans are being sent in a batch
47+
send_batch_max_size: 512
48+
## Time duration after which a batch will be sent regardless of size
49+
timeout: 5s
50+
51+
extensions:
52+
health_check: {}
53+
exporters:
54+
otlp:
55+
## Please enter OpenTelemetry Collector Gateway address here
56+
endpoint: HOSTNAME
57+
insecure: true
58+
## Following generates verbose logs with span content, useful to verify what
59+
## metadata is being tagged. To enable, uncomment and add "logging" to exporters below.
60+
## There are two levels that could be used: `debug` and `info` with the former
61+
## being much more verbose and including (sampled) spans content
62+
# logging:
63+
# loglevel: debug
64+
service:
65+
extensions: [health_check]
66+
pipelines:
67+
traces:
68+
receivers: [jaeger, opencensus, otlp, zipkin]
69+
processors: [memory_limiter, resourcedetection, batch]
70+
exporters: [otlp]
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
receivers:
2+
jaeger:
3+
protocols:
4+
thrift_compact:
5+
endpoint: "0.0.0.0:6831"
6+
thrift_binary:
7+
endpoint: "0.0.0.0:6832"
8+
grpc:
9+
endpoint: "0.0.0.0:14250"
10+
thrift_http:
11+
endpoint: "0.0.0.0:14268"
12+
opencensus:
13+
endpoint: "0.0.0.0:55678"
14+
otlp:
15+
protocols:
16+
grpc:
17+
endpoint: "0.0.0.0:4317"
18+
http:
19+
endpoint: "0.0.0.0:55681"
20+
zipkin:
21+
endpoint: "0.0.0.0:9411"
22+
processors:
23+
## The memory_limiter processor is used to prevent out of memory situations on the collector.
24+
memory_limiter:
25+
## check_interval is the time between measurements of memory usage for the
26+
## purposes of avoiding going over the limits. Defaults to zero, so no
27+
## checks will be performed. Values below 1 second are not recommended since
28+
## it can result in unnecessary CPU consumption.
29+
check_interval: 5s
30+
31+
## Maximum amount of memory, in MiB, targeted to be allocated by the process heap.
32+
## Note that typically the total memory usage of process will be about 50MiB higher
33+
## than this value.
34+
limit_mib: 1900
35+
36+
## Smart cascading filtering rules with preset limits.
37+
cascading_filter:
38+
## (default = 30s): Wait time since the first span of a trace arrived before making
39+
## a filtering decision
40+
decision_wait: 30s
41+
## (default = 50000): Maximum number of traces kept in memory
42+
num_traces: 100000
43+
## (default = 0): Expected number of new traces (helps in allocating data structures)
44+
expected_new_traces_per_sec: 1000
45+
## (default = 0): defines the global limit of maximum number of spans per second
46+
## that are going to be emitted
47+
spans_per_second: 1660
48+
## (default = 0.2): Ratio of spans that are always probabilistically filtered
49+
## (hence might be used for metrics calculation).
50+
probabilistic_filtering_ratio: 0.2
51+
## (no default): Policies used to make a sampling decision
52+
policies:
53+
- name: sampling-priority,
54+
## string_attribute: allows to specify conditions that need to be met
55+
string_attribute: {
56+
key: sampling.priority, values: [ "1" ]
57+
},
58+
## Spans_per_second: max number of emitted spans per second by this policy.
59+
spans_per_second: 500
60+
- name: extended-duration
61+
## Spans_per_second: max number of emitted spans per second by this policy.
62+
spans_per_second: 500
63+
properties:
64+
## Selects the span if the duration is greater or equal the given
65+
## value (use s or ms as the suffix to indicate unit).
66+
min_duration: 5s
67+
- name: "status_code_condition",
68+
## Spans_per_second: max number of emitted spans per second by this policy.
69+
spans_per_second: 500,
70+
## numeric_attribute: provides a list of conditions that need to be met
71+
numeric_attribute: {
72+
key: "http.status_code", min_value: 400, max_value: 999
73+
}
74+
- name: everything-else
75+
## This selects all traces, up the to the global limit
76+
spans_per_second: -1
77+
78+
## The batch processor accepts spans and places them into batches grouped by node and resource
79+
batch:
80+
## Number of spans after which a batch will be sent regardless of time
81+
send_batch_size: 256
82+
## Never more than this many spans are being sent in a batch
83+
send_batch_max_size: 512
84+
## Time duration after which a batch will be sent regardless of size
85+
timeout: 5s
86+
87+
extensions:
88+
health_check: {}
89+
exporters:
90+
zipkin:
91+
endpoint: ENDPOINT_URL
92+
## Following generates verbose logs with span content, useful to verify what
93+
## metadata is being tagged. To enable, uncomment and add "logging" to exporters below.
94+
## There are two levels that could be used: `debug` and `info` with the former
95+
## being much more verbose and including (sampled) spans content
96+
# logging:
97+
# loglevel: debug
98+
service:
99+
extensions: [health_check]
100+
pipelines:
101+
traces:
102+
receivers: [jaeger, opencensus, otlp, zipkin]
103+
processors: [memory_limiter, cascading_filter, batch]
104+
exporters: [zipkin]
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
receivers:
2+
jaeger:
3+
protocols:
4+
thrift_compact:
5+
endpoint: "0.0.0.0:6831"
6+
thrift_binary:
7+
endpoint: "0.0.0.0:6832"
8+
grpc:
9+
endpoint: "0.0.0.0:14250"
10+
thrift_http:
11+
endpoint: "0.0.0.0:14268"
12+
opencensus:
13+
endpoint: "0.0.0.0:55678"
14+
otlp:
15+
protocols:
16+
grpc:
17+
endpoint: "0.0.0.0:4317"
18+
http:
19+
endpoint: "0.0.0.0:55681"
20+
zipkin:
21+
endpoint: "0.0.0.0:9411"
22+
processors:
23+
## The memory_limiter processor is used to prevent out of memory situations on the collector.
24+
memory_limiter:
25+
## check_interval is the time between measurements of memory usage for the
26+
## purposes of avoiding going over the limits. Defaults to zero, so no
27+
## checks will be performed. Values below 1 second are not recommended since
28+
## it can result in unnecessary CPU consumption.
29+
check_interval: 5s
30+
31+
## Maximum amount of memory, in MiB, targeted to be allocated by the process heap.
32+
## Note that typically the total memory usage of process will be about 50MiB higher
33+
## than this value.
34+
limit_mib: 1900
35+
36+
## The batch processor accepts spans and places them into batches grouped by node and resource
37+
batch:
38+
## Number of spans after which a batch will be sent regardless of time
39+
send_batch_size: 256
40+
## Never more than this many spans are being sent in a batch
41+
send_batch_max_size: 512
42+
## Time duration after which a batch will be sent regardless of size
43+
timeout: 5s
44+
45+
extensions:
46+
health_check: {}
47+
exporters:
48+
zipkin:
49+
endpoint: ENDPOINT_URL
50+
## Following generates verbose logs with span content, useful to verify what
51+
## metadata is being tagged. To enable, uncomment and add "logging" to exporters below.
52+
## There are two levels that could be used: `debug` and `info` with the former
53+
## being much more verbose and including (sampled) spans content
54+
# logging:
55+
# loglevel: debug
56+
service:
57+
extensions: [health_check]
58+
pipelines:
59+
traces:
60+
receivers: [jaeger, opencensus, otlp, zipkin]
61+
processors: [memory_limiter, batch]
62+
exporters: [zipkin]

0 commit comments

Comments
 (0)