From aba8d2ec0cb6755454f2ade7c1c6acbcb9401bce Mon Sep 17 00:00:00 2001 From: Antoine Toulme Date: Mon, 19 Dec 2022 09:23:00 -0800 Subject: [PATCH] fix configuration (#9) * fix configuration * Update setup/config_without_sa.yaml Co-authored-by: Dmitrii Anoshin * fix indentation * Update test/config.yaml Co-authored-by: Dmitrii Anoshin * code review indentation changes Co-authored-by: Dmitrii Anoshin --- setup/config.yaml | 15 ++--- setup/config_without_sa.yaml | 83 +++++++++++------------ test/config.yaml | 123 +++++++++++++++-------------------- 3 files changed, 94 insertions(+), 127 deletions(-) diff --git a/setup/config.yaml b/setup/config.yaml index bca520e..254dbfa 100644 --- a/setup/config.yaml +++ b/setup/config.yaml @@ -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: @@ -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: @@ -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 @@ -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] diff --git a/setup/config_without_sa.yaml b/setup/config_without_sa.yaml index d29354c..df9c10d 100644 --- a/setup/config_without_sa.yaml +++ b/setup/config_without_sa.yaml @@ -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: @@ -40,14 +42,14 @@ 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: @@ -55,45 +57,36 @@ 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: 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: @@ -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: @@ -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: diff --git a/test/config.yaml b/test/config.yaml index c466258..a94338d 100644 --- a/test/config.yaml +++ b/test/config.yaml @@ -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: @@ -38,25 +36,20 @@ 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: @@ -64,47 +57,36 @@ 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: 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: @@ -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]