Skip to content

Commit

Permalink
fix configuration (#9)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
atoulme and dmitryax authored Dec 19, 2022
1 parent 02a13e8 commit aba8d2e
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 127 deletions.
15 changes: 4 additions & 11 deletions setup/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ extensions:
configDir: "${SPLUNK_COLLECTD_DIR}"
zpages:
#endpoint: 0.0.0.0:55679
memory_ballast:
size_mib: ${SPLUNK_BALLAST_SIZE_MIB}

receivers:
jaeger:
Expand Down Expand Up @@ -64,16 +66,7 @@ receivers:

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

# Send to gateway
Expand All @@ -135,7 +128,7 @@ exporters:
loglevel: debug

service:
extensions: [health_check, http_forwarder, zpages]
extensions: [health_check, http_forwarder, zpages, memory_ballast]
pipelines:
traces:
receivers: [jaeger, otlp, smartagent/signalfx-forwarder, zipkin]
Expand Down
83 changes: 38 additions & 45 deletions setup/config_without_sa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ extensions:
#endpoint: "${SPLUNK_GATEWAY_URL}"
zpages:
#endpoint: 0.0.0.0:55679
memory_ballast:
size_mib: ${SPLUNK_BALLAST_SIZE_MIB}

receivers:
jaeger:
Expand All @@ -40,60 +42,51 @@ receivers:
prometheus/internal:
config:
scrape_configs:
- job_name: 'otel-collector'
scrape_interval: 10s
static_configs:
- targets: ['0.0.0.0:8888']
metric_relabel_configs:
- source_labels: [ __name__ ]
regex: '.*grpc_io.*'
action: drop
- job_name: 'otel-collector'
scrape_interval: 10s
static_configs:
- targets: ['0.0.0.0:8888']
metric_relabel_configs:
- source_labels: [ __name__ ]
regex: '.*grpc_io.*'
action: drop
signalfx:
endpoint: 0.0.0.0:9943
zipkin:
endpoint: 0.0.0.0:9411

processors:
batch:
# Enabling the memory_limiter is strongly recommended for every pipeline.
# Configuration is based on the amount of memory allocated to the collector.
# In general, the ballast should be set to 1/3 of the collector's memory, the limit
# should be 90% of the collector's memory up to 2GB. The simplest way to specify the
# ballast size is set the value of SPLUNK_BALLAST_SIZE_MIB env variable. Alternatively, the
# --mem-ballast-size-mib command line flag can be passed and take priority.
# For more information about memory limiter, see
# https://github.com/open-telemetry/opentelemetry-collector/blob/main/processor/memorylimiter/README.md
memory_limiter:
ballast_size_mib: ${SPLUNK_BALLAST_SIZE_MIB}
check_interval: 2s
limit_mib: ${SPLUNK_MEMORY_LIMIT_MIB}
attributes/heroku:
actions:
- action: insert
key: dyno_id
value: ${env:HEROKU_DYNO_ID}
- action: insert
key: app_id
value: ${env:HEROKU_APP_ID}
- action: insert
key: app_name
value: ${env:HEROKU_APP_NAME}
- action: insert
key: dyno_id
value: ${env:HEROKU_DYNO_ID}
- action: insert
key: app_id
value: ${env:HEROKU_APP_ID}
- action: insert
key: app_name
value: ${env:HEROKU_APP_NAME}
metricstransform/heroku:
transforms:
- include: .*
match_type: regexp
action: update
operations:
- action: add_label
new_label: dyno_id
new_value: ${env:HEROKU_DYNO_ID}
- action: add_label
new_label: app_id
new_value: ${env:HEROKU_APP_ID}
- action: add_label
new_label: app_name
new_value: ${env:HEROKU_APP_NAME}
# Optional: The following processor can be used to add a default "deployment.environment" attribute to the logs and
- include: .*
match_type: regexp
action: update
operations:
- action: add_label
new_label: dyno_id
new_value: ${env:HEROKU_DYNO_ID}
- action: add_label
new_label: app_id
new_value: ${env:HEROKU_APP_ID}
- action: add_label
new_label: app_name
new_value: ${env:HEROKU_APP_NAME}
# Optional: The following processor can be used to add a default "deployment.environment" attribute to the logs and
# traces when it's not populated by instrumentation libraries.
# If enabled, make sure to enable this processor in the pipeline below.
#resource/add_environment:
Expand All @@ -113,7 +106,7 @@ exporters:
api_url: "${SPLUNK_API_URL}"
ingest_url: "${SPLUNK_INGEST_URL}"
splunk_hec/profiling:
access_token: "${SPLUNK_ACCESS_TOKEN}"
token: "${SPLUNK_ACCESS_TOKEN}"
endpoint: "${SPLUNK_PROFILING_URL}"
# Send to gateway
#otlp:
Expand All @@ -125,14 +118,14 @@ exporters:
loglevel: debug

service:
extensions: [health_check, http_forwarder, zpages]
extensions: [health_check, http_forwarder, zpages, memory_ballast]
pipelines:
traces:
receivers: [jaeger, otlp, zipkin]
processors:
- memory_limiter
- batch
- attributes/heroku
- memory_limiter
- batch
- attributes/heroku
#- resource/add_environment
exporters: [sapm, signalfx]
metrics:
Expand Down
123 changes: 52 additions & 71 deletions test/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,13 @@ extensions:
ingress:
endpoint: 0.0.0.0:6060
egress:
endpoint: "https://api.${SPLUNK_REALM}.signalfx.com"
endpoint: "${SPLUNK_API_URL}"
# Use instead when sending to gateway
#endpoint: "${SPLUNK_GATEWAY_URL}"
smartagent:
bundleDir: "${SPLUNK_BUNDLE_DIR}"
collectd:
configDir: "${SPLUNK_COLLECTD_DIR}"
zpages:
#endpoint: 0.0.0.0:55679
memory_ballast:
size_mib: ${SPLUNK_BALLAST_SIZE_MIB}

receivers:
jaeger:
Expand All @@ -38,73 +36,57 @@ receivers:
grpc:
endpoint: 0.0.0.0:4317
http:
endpoint: 0.0.0.0:55681
endpoint: 0.0.0.0:4318
# This section is used to collect the OpenTelemetry Collector metrics
# Even if just a Splunk APM customer, these metrics are included
prometheus/internal:
config:
scrape_configs:
- job_name: 'otel-collector'
scrape_interval: 10s
static_configs:
- targets: ['0.0.0.0:8888']
metric_relabel_configs:
- source_labels: [ __name__ ]
regex: '.*grpc_io.*'
action: drop
smartagent/heroku-metadata:
type: heroku-metadata
smartagent/signalfx-forwarder:
type: signalfx-forwarder
listenAddress: 0.0.0.0:9080
- job_name: 'otel-collector'
scrape_interval: 10s
static_configs:
- targets: ['0.0.0.0:8888']
metric_relabel_configs:
- source_labels: [ __name__ ]
regex: '.*grpc_io.*'
action: drop
signalfx:
endpoint: 0.0.0.0:9943
zipkin:
endpoint: 0.0.0.0:9411

processors:
batch:
# Enabling the memory_limiter is strongly recommended for every pipeline.
# Configuration is based on the amount of memory allocated to the collector.
# In general, the ballast should be set to 1/3 of the collector's memory, the limit
# should be 90% of the collector's memory up to 2GB. The simplest way to specify the
# ballast size is set the value of SPLUNK_BALLAST_SIZE_MIB env variable. Alternatively, the
# --mem-ballast-size-mib command line flag can be passed and take priority.
# For more information about memory limiter, see
# https://github.com/open-telemetry/opentelemetry-collector/blob/main/processor/memorylimiter/README.md
memory_limiter:
ballast_size_mib: ${SPLUNK_BALLAST_SIZE_MIB}
check_interval: 2s
limit_mib: ${SPLUNK_MEMORY_LIMIT_MIB}
attributes/heroku:
actions:
- action: insert
key: dyno_id
value: ${env:HEROKU_DYNO_ID}
- action: insert
key: app_id
value: ${env:HEROKU_APP_ID}
- action: insert
key: app_name
value: ${env:HEROKU_APP_NAME}
# TODO [flands]: Does not work if env var is empty
# Also unclear whether this behaves like insert of attributes processor
- action: insert
key: dyno_id
value: ${env:HEROKU_DYNO_ID}
- action: insert
key: app_id
value: ${env:HEROKU_APP_ID}
- action: insert
key: app_name
value: ${env:HEROKU_APP_NAME}
metricstransform/heroku:
transforms:
- include: .*
match_type: regexp
action: update
operations:
- action: add_label
new_label: dyno_id
new_value: ${env:HEROKU_DYNO_ID}
- action: add_label
new_label: app_id
new_value: ${env:HEROKU_APP_ID}
- action: add_label
new_label: app_name
new_value: ${env:HEROKU_APP_NAME}
# Optional: The following processor can be used to add a default "deployment.environment" attribute to the logs and
- include: .*
match_type: regexp
action: update
operations:
- action: add_label
new_label: dyno_id
new_value: ${env:HEROKU_DYNO_ID}
- action: add_label
new_label: app_id
new_value: ${env:HEROKU_APP_ID}
- action: add_label
new_label: app_name
new_value: ${env:HEROKU_APP_NAME}
# Optional: The following processor can be used to add a default "deployment.environment" attribute to the logs and
# traces when it's not populated by instrumentation libraries.
# If enabled, make sure to enable this processor in the pipeline below.
#resource/add_environment:
Expand All @@ -117,44 +99,43 @@ exporters:
# Traces
sapm:
access_token: "${SPLUNK_ACCESS_TOKEN}"
endpoint: "https://ingest.${SPLUNK_REALM}.signalfx.com/v2/trace"
endpoint: "${SPLUNK_TRACE_URL}"
# Metrics + Events
signalfx:
access_token: "${SPLUNK_ACCESS_TOKEN}"
realm: "${SPLUNK_REALM}"
# Use instead when sending to gateway
#api_url: http://${SPLUNK_GATEWAY_URL}:6060
#ingest_url: http://${SPLUNK_GATEWAY_URL}:9943
splunk_hec/profiling:
token: "${SPLUNK_ACCESS_TOKEN}"
endpoint: "${SPLUNK_PROFILING_URL}"
# Send to gateway
#otlp:
# endpoint: "${SPLUNK_GATEWAY_URL}:4317"
# insecure: true
# Debug

# Debug. Add this to the pipeline you want to debug.
logging:
loglevel: debug

service:
extensions: [health_check, http_forwarder, zpages]
extensions: [health_check, http_forwarder, zpages, memory_ballast]
pipelines:
traces:
receivers: [jaeger, otlp, smartagent/signalfx-forwarder, zipkin]
receivers: [jaeger, otlp, zipkin]
processors:
- memory_limiter
- batch
- attributes/heroku
- memory_limiter
- batch
- attributes/heroku
#- resource/add_environment
exporters: [sapm, signalfx]
# Use instead when sending to gateway
#exporters: [otlp, signalfx]
metrics:
receivers: [otlp, signalfx, smartagent/heroku-metadata, smartagent/signalfx-forwarder]
receivers: [otlp, signalfx]
processors: [memory_limiter, batch, metricstransform/heroku]
exporters: [signalfx, logging]
# Use instead when sending to gateway
#exporters: [otlp]
exporters: [signalfx]
metrics/internal:
receivers: [prometheus/internal]
processors: [memory_limiter, batch, metricstransform/heroku]
exporters: [signalfx]
# Use instead when sending to gateway
#exporters: [otlp]
logs/profiling:
receivers: [otlp]
processors: [memory_limiter, batch, attributes/heroku]
exporters: [splunk_hec/profiling]

0 comments on commit aba8d2e

Please sign in to comment.