Skip to content

Commit aba8d2e

Browse files
atoulmedmitryax
andauthored
fix configuration (#9)
* fix configuration * Update setup/config_without_sa.yaml Co-authored-by: Dmitrii Anoshin <[email protected]> * fix indentation * Update test/config.yaml Co-authored-by: Dmitrii Anoshin <[email protected]> * code review indentation changes Co-authored-by: Dmitrii Anoshin <[email protected]>
1 parent 02a13e8 commit aba8d2e

File tree

3 files changed

+94
-127
lines changed

3 files changed

+94
-127
lines changed

setup/config.yaml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ extensions:
2121
configDir: "${SPLUNK_COLLECTD_DIR}"
2222
zpages:
2323
#endpoint: 0.0.0.0:55679
24+
memory_ballast:
25+
size_mib: ${SPLUNK_BALLAST_SIZE_MIB}
2426

2527
receivers:
2628
jaeger:
@@ -64,16 +66,7 @@ receivers:
6466

6567
processors:
6668
batch:
67-
# Enabling the memory_limiter is strongly recommended for every pipeline.
68-
# Configuration is based on the amount of memory allocated to the collector.
69-
# In general, the ballast should be set to 1/3 of the collector's memory, the limit
70-
# should be 90% of the collector's memory up to 2GB. The simplest way to specify the
71-
# ballast size is set the value of SPLUNK_BALLAST_SIZE_MIB env variable. Alternatively, the
72-
# --mem-ballast-size-mib command line flag can be passed and take priority.
73-
# For more information about memory limiter, see
74-
# https://github.com/open-telemetry/opentelemetry-collector/blob/main/processor/memorylimiter/README.md
7569
memory_limiter:
76-
ballast_size_mib: ${SPLUNK_BALLAST_SIZE_MIB}
7770
check_interval: 2s
7871
limit_mib: ${SPLUNK_MEMORY_LIMIT_MIB}
7972
attributes/heroku:
@@ -122,7 +115,7 @@ exporters:
122115
api_url: "${SPLUNK_API_URL}"
123116
ingest_url: "${SPLUNK_INGEST_URL}"
124117
splunk_hec/profiling:
125-
access_token: "${SPLUNK_ACCESS_TOKEN}"
118+
token: "${SPLUNK_ACCESS_TOKEN}"
126119
endpoint: "${SPLUNK_PROFILING_URL}"
127120

128121
# Send to gateway
@@ -135,7 +128,7 @@ exporters:
135128
loglevel: debug
136129

137130
service:
138-
extensions: [health_check, http_forwarder, zpages]
131+
extensions: [health_check, http_forwarder, zpages, memory_ballast]
139132
pipelines:
140133
traces:
141134
receivers: [jaeger, otlp, smartagent/signalfx-forwarder, zipkin]

setup/config_without_sa.yaml

Lines changed: 38 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ extensions:
1717
#endpoint: "${SPLUNK_GATEWAY_URL}"
1818
zpages:
1919
#endpoint: 0.0.0.0:55679
20+
memory_ballast:
21+
size_mib: ${SPLUNK_BALLAST_SIZE_MIB}
2022

2123
receivers:
2224
jaeger:
@@ -40,60 +42,51 @@ receivers:
4042
prometheus/internal:
4143
config:
4244
scrape_configs:
43-
- job_name: 'otel-collector'
44-
scrape_interval: 10s
45-
static_configs:
46-
- targets: ['0.0.0.0:8888']
47-
metric_relabel_configs:
48-
- source_labels: [ __name__ ]
49-
regex: '.*grpc_io.*'
50-
action: drop
45+
- job_name: 'otel-collector'
46+
scrape_interval: 10s
47+
static_configs:
48+
- targets: ['0.0.0.0:8888']
49+
metric_relabel_configs:
50+
- source_labels: [ __name__ ]
51+
regex: '.*grpc_io.*'
52+
action: drop
5153
signalfx:
5254
endpoint: 0.0.0.0:9943
5355
zipkin:
5456
endpoint: 0.0.0.0:9411
5557

5658
processors:
5759
batch:
58-
# Enabling the memory_limiter is strongly recommended for every pipeline.
59-
# Configuration is based on the amount of memory allocated to the collector.
60-
# In general, the ballast should be set to 1/3 of the collector's memory, the limit
61-
# should be 90% of the collector's memory up to 2GB. The simplest way to specify the
62-
# ballast size is set the value of SPLUNK_BALLAST_SIZE_MIB env variable. Alternatively, the
63-
# --mem-ballast-size-mib command line flag can be passed and take priority.
64-
# For more information about memory limiter, see
65-
# https://github.com/open-telemetry/opentelemetry-collector/blob/main/processor/memorylimiter/README.md
6660
memory_limiter:
67-
ballast_size_mib: ${SPLUNK_BALLAST_SIZE_MIB}
6861
check_interval: 2s
6962
limit_mib: ${SPLUNK_MEMORY_LIMIT_MIB}
7063
attributes/heroku:
7164
actions:
72-
- action: insert
73-
key: dyno_id
74-
value: ${env:HEROKU_DYNO_ID}
75-
- action: insert
76-
key: app_id
77-
value: ${env:HEROKU_APP_ID}
78-
- action: insert
79-
key: app_name
80-
value: ${env:HEROKU_APP_NAME}
65+
- action: insert
66+
key: dyno_id
67+
value: ${env:HEROKU_DYNO_ID}
68+
- action: insert
69+
key: app_id
70+
value: ${env:HEROKU_APP_ID}
71+
- action: insert
72+
key: app_name
73+
value: ${env:HEROKU_APP_NAME}
8174
metricstransform/heroku:
8275
transforms:
83-
- include: .*
84-
match_type: regexp
85-
action: update
86-
operations:
87-
- action: add_label
88-
new_label: dyno_id
89-
new_value: ${env:HEROKU_DYNO_ID}
90-
- action: add_label
91-
new_label: app_id
92-
new_value: ${env:HEROKU_APP_ID}
93-
- action: add_label
94-
new_label: app_name
95-
new_value: ${env:HEROKU_APP_NAME}
96-
# Optional: The following processor can be used to add a default "deployment.environment" attribute to the logs and
76+
- include: .*
77+
match_type: regexp
78+
action: update
79+
operations:
80+
- action: add_label
81+
new_label: dyno_id
82+
new_value: ${env:HEROKU_DYNO_ID}
83+
- action: add_label
84+
new_label: app_id
85+
new_value: ${env:HEROKU_APP_ID}
86+
- action: add_label
87+
new_label: app_name
88+
new_value: ${env:HEROKU_APP_NAME}
89+
# Optional: The following processor can be used to add a default "deployment.environment" attribute to the logs and
9790
# traces when it's not populated by instrumentation libraries.
9891
# If enabled, make sure to enable this processor in the pipeline below.
9992
#resource/add_environment:
@@ -113,7 +106,7 @@ exporters:
113106
api_url: "${SPLUNK_API_URL}"
114107
ingest_url: "${SPLUNK_INGEST_URL}"
115108
splunk_hec/profiling:
116-
access_token: "${SPLUNK_ACCESS_TOKEN}"
109+
token: "${SPLUNK_ACCESS_TOKEN}"
117110
endpoint: "${SPLUNK_PROFILING_URL}"
118111
# Send to gateway
119112
#otlp:
@@ -125,14 +118,14 @@ exporters:
125118
loglevel: debug
126119

127120
service:
128-
extensions: [health_check, http_forwarder, zpages]
121+
extensions: [health_check, http_forwarder, zpages, memory_ballast]
129122
pipelines:
130123
traces:
131124
receivers: [jaeger, otlp, zipkin]
132125
processors:
133-
- memory_limiter
134-
- batch
135-
- attributes/heroku
126+
- memory_limiter
127+
- batch
128+
- attributes/heroku
136129
#- resource/add_environment
137130
exporters: [sapm, signalfx]
138131
metrics:

test/config.yaml

Lines changed: 52 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,13 @@ extensions:
1212
ingress:
1313
endpoint: 0.0.0.0:6060
1414
egress:
15-
endpoint: "https://api.${SPLUNK_REALM}.signalfx.com"
15+
endpoint: "${SPLUNK_API_URL}"
1616
# Use instead when sending to gateway
1717
#endpoint: "${SPLUNK_GATEWAY_URL}"
18-
smartagent:
19-
bundleDir: "${SPLUNK_BUNDLE_DIR}"
20-
collectd:
21-
configDir: "${SPLUNK_COLLECTD_DIR}"
2218
zpages:
2319
#endpoint: 0.0.0.0:55679
20+
memory_ballast:
21+
size_mib: ${SPLUNK_BALLAST_SIZE_MIB}
2422

2523
receivers:
2624
jaeger:
@@ -38,73 +36,57 @@ receivers:
3836
grpc:
3937
endpoint: 0.0.0.0:4317
4038
http:
41-
endpoint: 0.0.0.0:55681
39+
endpoint: 0.0.0.0:4318
4240
# This section is used to collect the OpenTelemetry Collector metrics
4341
# Even if just a Splunk APM customer, these metrics are included
4442
prometheus/internal:
4543
config:
4644
scrape_configs:
47-
- job_name: 'otel-collector'
48-
scrape_interval: 10s
49-
static_configs:
50-
- targets: ['0.0.0.0:8888']
51-
metric_relabel_configs:
52-
- source_labels: [ __name__ ]
53-
regex: '.*grpc_io.*'
54-
action: drop
55-
smartagent/heroku-metadata:
56-
type: heroku-metadata
57-
smartagent/signalfx-forwarder:
58-
type: signalfx-forwarder
59-
listenAddress: 0.0.0.0:9080
45+
- job_name: 'otel-collector'
46+
scrape_interval: 10s
47+
static_configs:
48+
- targets: ['0.0.0.0:8888']
49+
metric_relabel_configs:
50+
- source_labels: [ __name__ ]
51+
regex: '.*grpc_io.*'
52+
action: drop
6053
signalfx:
6154
endpoint: 0.0.0.0:9943
6255
zipkin:
6356
endpoint: 0.0.0.0:9411
6457

6558
processors:
6659
batch:
67-
# Enabling the memory_limiter is strongly recommended for every pipeline.
68-
# Configuration is based on the amount of memory allocated to the collector.
69-
# In general, the ballast should be set to 1/3 of the collector's memory, the limit
70-
# should be 90% of the collector's memory up to 2GB. The simplest way to specify the
71-
# ballast size is set the value of SPLUNK_BALLAST_SIZE_MIB env variable. Alternatively, the
72-
# --mem-ballast-size-mib command line flag can be passed and take priority.
73-
# For more information about memory limiter, see
74-
# https://github.com/open-telemetry/opentelemetry-collector/blob/main/processor/memorylimiter/README.md
7560
memory_limiter:
76-
ballast_size_mib: ${SPLUNK_BALLAST_SIZE_MIB}
7761
check_interval: 2s
7862
limit_mib: ${SPLUNK_MEMORY_LIMIT_MIB}
7963
attributes/heroku:
8064
actions:
81-
- action: insert
82-
key: dyno_id
83-
value: ${env:HEROKU_DYNO_ID}
84-
- action: insert
85-
key: app_id
86-
value: ${env:HEROKU_APP_ID}
87-
- action: insert
88-
key: app_name
89-
value: ${env:HEROKU_APP_NAME}
90-
# TODO [flands]: Does not work if env var is empty
91-
# Also unclear whether this behaves like insert of attributes processor
65+
- action: insert
66+
key: dyno_id
67+
value: ${env:HEROKU_DYNO_ID}
68+
- action: insert
69+
key: app_id
70+
value: ${env:HEROKU_APP_ID}
71+
- action: insert
72+
key: app_name
73+
value: ${env:HEROKU_APP_NAME}
9274
metricstransform/heroku:
9375
transforms:
94-
- include: .*
95-
match_type: regexp
96-
action: update
97-
operations:
98-
- action: add_label
99-
new_label: dyno_id
100-
new_value: ${env:HEROKU_DYNO_ID}
101-
- action: add_label
102-
new_label: app_id
103-
new_value: ${env:HEROKU_APP_ID}
104-
- action: add_label
105-
new_label: app_name
106-
new_value: ${env:HEROKU_APP_NAME}
107-
# Optional: The following processor can be used to add a default "deployment.environment" attribute to the logs and
76+
- include: .*
77+
match_type: regexp
78+
action: update
79+
operations:
80+
- action: add_label
81+
new_label: dyno_id
82+
new_value: ${env:HEROKU_DYNO_ID}
83+
- action: add_label
84+
new_label: app_id
85+
new_value: ${env:HEROKU_APP_ID}
86+
- action: add_label
87+
new_label: app_name
88+
new_value: ${env:HEROKU_APP_NAME}
89+
# Optional: The following processor can be used to add a default "deployment.environment" attribute to the logs and
10890
# traces when it's not populated by instrumentation libraries.
10991
# If enabled, make sure to enable this processor in the pipeline below.
11092
#resource/add_environment:
@@ -117,44 +99,43 @@ exporters:
11799
# Traces
118100
sapm:
119101
access_token: "${SPLUNK_ACCESS_TOKEN}"
120-
endpoint: "https://ingest.${SPLUNK_REALM}.signalfx.com/v2/trace"
102+
endpoint: "${SPLUNK_TRACE_URL}"
121103
# Metrics + Events
122104
signalfx:
123105
access_token: "${SPLUNK_ACCESS_TOKEN}"
124106
realm: "${SPLUNK_REALM}"
125-
# Use instead when sending to gateway
126-
#api_url: http://${SPLUNK_GATEWAY_URL}:6060
127-
#ingest_url: http://${SPLUNK_GATEWAY_URL}:9943
107+
splunk_hec/profiling:
108+
token: "${SPLUNK_ACCESS_TOKEN}"
109+
endpoint: "${SPLUNK_PROFILING_URL}"
128110
# Send to gateway
129111
#otlp:
130112
# endpoint: "${SPLUNK_GATEWAY_URL}:4317"
131113
# insecure: true
132-
# Debug
114+
115+
# Debug. Add this to the pipeline you want to debug.
133116
logging:
134117
loglevel: debug
135118

136119
service:
137-
extensions: [health_check, http_forwarder, zpages]
120+
extensions: [health_check, http_forwarder, zpages, memory_ballast]
138121
pipelines:
139122
traces:
140-
receivers: [jaeger, otlp, smartagent/signalfx-forwarder, zipkin]
123+
receivers: [jaeger, otlp, zipkin]
141124
processors:
142-
- memory_limiter
143-
- batch
144-
- attributes/heroku
125+
- memory_limiter
126+
- batch
127+
- attributes/heroku
145128
#- resource/add_environment
146129
exporters: [sapm, signalfx]
147-
# Use instead when sending to gateway
148-
#exporters: [otlp, signalfx]
149130
metrics:
150-
receivers: [otlp, signalfx, smartagent/heroku-metadata, smartagent/signalfx-forwarder]
131+
receivers: [otlp, signalfx]
151132
processors: [memory_limiter, batch, metricstransform/heroku]
152-
exporters: [signalfx, logging]
153-
# Use instead when sending to gateway
154-
#exporters: [otlp]
133+
exporters: [signalfx]
155134
metrics/internal:
156135
receivers: [prometheus/internal]
157136
processors: [memory_limiter, batch, metricstransform/heroku]
158137
exporters: [signalfx]
159-
# Use instead when sending to gateway
160-
#exporters: [otlp]
138+
logs/profiling:
139+
receivers: [otlp]
140+
processors: [memory_limiter, batch, attributes/heroku]
141+
exporters: [splunk_hec/profiling]

0 commit comments

Comments
 (0)