Skip to main content

Stream Logs from Heroku to SigNoz

If you are running your applications on heroku, you can stream logs from Heroku to SigNoz using httpsdrain.

Stream Heroku logs to SigNoz in SigNoz cloud

  • Use the heroku cli to add a https drain

    heroku drains:add https://<TENANT_NAME>:<SIGNOZ_INGESTION_KEY>@ingest.<REGION>.signoz.cloud:443/logs/heroku -a <YOUR_APP_NAME>

    Set the values of <TENANT_NAME>, <SIGNOZ_INGESTION_KEY>, <REGION> and <YOUR APP NAME>.

    <TENANT_NAME> is name of your instance. Ex:- If the url is https://cpvo-test.us.signoz.cloud the TENANT_NAME is cpvo-test.

    <SIGNOZ_INGESTION_KEY> is the ingestion key.

    <YOUR_APP_NAME> is the name of the application where you want to add the drain.

    Depending on the choice of your region for SigNoz cloud, the otlp endpoint will vary according to this table.

    RegionEndpoint
    USingest.us.signoz.cloud:443
    INingest.in.signoz.cloud:443
    EUingest.eu.signoz.cloud:443
  • Once added you can verify by going to the SigNoz UI.

Stream Heroku logs to SigNoz in Self-Hosted SigNoz

  • Modify the docker-compose.yaml file present inside deploy/docker/clickhouse-setup to expose a port, in this case 8081.

    ...
    otel-collector:
    image: signoz/signoz-otel-collector:0.88.11
    command: ["--config=/etc/otel-collector-config.yaml"]
    volumes:
    - ./otel-collector-config.yaml:/etc/otel-collector-config.yaml
    ports:
    - "8081:8081"
    ...
  • Add the httplogreceiver reciever to otel-collector-config.yaml which is present inside deploy/docker/clickhouse-setup

    receivers:
    httplogreceiver/heroku:
    endpoint: 0.0.0.0:8081
    source: heroku
    ...
  • Next we will modify our pipeline inside otel-collector-config.yaml to include the receiver we have created above.

    service:
    ....
    logs:
    receivers: [otlp, httplogreceiver/heroku]
    processors: [batch]
    exporters: [clickhouselogsexporter]
  • Now we can restart the otel collector container so that new changes are applied and we can forward our logs to port 8081.

  • Use the heroku cli to add a https drain

    heroku drains:add http://<IP>:8081 -a <YOUR_APP_NAME>

    Replace IP with IP of the system where your collector is running. For more info check troubleshooting.

  • Once added you can verify by going to the SigNoz UI.