signalfx / splunk-otel-collector

Apache License 2.0
191 stars 153 forks source link

Send metric to signalfx via opentelemetry #41

Closed aishvaryaps closed 3 years ago

aishvaryaps commented 3 years ago

Hello, I have configured open telemetry on a machine and have configured the otel collector to report the metric and traces to SignalFx ( have provided token and ingest URL)

  1. I can see my Application traces being reported to SignalFx via otel
  2. I cannot see metric being reported to SignalFx via otel.
  3. Without otel if I configure my agent to report metric to SignalFx I can see metrics in SignalFx I believe the otel is configured correctly because i can see the traces

SignalFx agent.yaml is as below:

traceEndpointUrl: "http://<ip>:7276/v2/trace"
signalFxAccessToken: {"#from": "/etc/signalfx/token"}
ingestUrl: "http://<ip>:8888"
apiUrl: {"#from": "/etc/signalfx/api_url", default: "https://api.us1.signalfx.com"}
cluster: {"#from": "/etc/signalfx/cluster", optional: true}

Is there any change required in ingest URL configuration. as per the doc metric report on port 8888.. right ?

below is otel configuration:

extensions:
  health_check:
  http_forwarder:
    egress:
      endpoint: "https://api.us1.signalfx.com"
  zpages:
receivers:
  sapm:
  signalfx:
  # This section is used to collect the OpenTelemetry Collector metrics
  # Even if just a SignalFx µAPM customer, these metrics are included
  prometheus:
    config:
      scrape_configs:
        - job_name: 'otel-collector'
          scrape_interval: 10s
          static_configs:
            - targets: ['localhost:8888']
              # If you want to use the environment filter
              # In the SignalFx dashboard
              #labels:
                #environment: demo
          metric_relabel_configs:
            - source_labels: [ __name__ ]
              regex: '.*grpc_io.*'
              action: drop
  # Enable Zipkin to support Istio Mixer Adapter
  # https://github.com/signalfx/signalfx-istio-adapter
  zipkin:
processors:
  batch:
  # Optional: If you have a different environment tag name
  # If this option is enabled it must be added to the pipeline section below
  #attributes/copyfromexistingkey:
    #actions:
    #- key: environment
      #from_attribute: YOUR_EXISTING_TAG_NAMEE
      #action: upsert
  # Optional: If you want to add an environment tag
  # If this option is enabled it must be added to the pipeline section below
  #attributes/newenvironment:
    #actions:
    #- key: environment
      #value: "YOUR_ENVIRONMENT_NAME"
      #action: insert
  # Enabling the memory_limiter is strongly recommended for every pipeline.
  # Configuration is based on the amount of memory allocated to the collector.
  # The configuration below assumes 2GB of memory. 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, and the spike should be 25% of the
  # collector's memory up to 2GB. In addition, the "--mem-ballast-size-mib" CLI
  # flag must be set to the same value as the "ballast_size_mib". For more
  # information, see
  # https://github.com/open-telemetry/opentelemetry-collector/blob/master/processor/memorylimiter/README.md
  memory_limiter:
    ballast_size_mib: 683
    check_interval: 2s
    limit_mib: 1800
    spike_limit_mib: 500
exporters:
  # Traces
  sapm:
    access_token: "<token>"
    endpoint: "https://ingest.us1.signalfx.com/v2/trace"
  # Metrics + Events
  signalfx:
    access_token: "<token>"
    realm: "us1"
service:
  pipelines:
    traces:
      receivers: [sapm, zipkin]
      processors: [memory_limiter, batch]
      exporters: [sapm]
    metrics:
      receivers: [signalfx, prometheus]
      processors: [memory_limiter, batch]
      exporters: [signalfx]
    logs:
      receivers: [signalfx]
      processors: [memory_limiter, batch]
      exporters: [signalfx]
  extensions: [health_check, http_forwarder, zpages]
jrcamp commented 3 years ago

Looks like your agent is sending to port 8888 but the signalfxreceiver listens on 9943 by default. Should you change ingestUrl to be 9943?

jrcamp commented 3 years ago

Also if you want property updates to forward you will need to change apiUrl as well to <ip>:6060.

aishvaryaps commented 3 years ago

Works for me.. Thanks