Docker

note: We currently don't support profiling .NET apps on Linux. Upvote this feature request to indicate your interest.

Raygun APM Docker images can be found on dockerhub.

To pull the latest Raygun APM Agent image and run it, use the following commands:

docker pull raygunowner/raygun-apm:latest
docker run --name raygun-agent -v raygun-agent:/usr/share/Raygun -e "RAYGUN_AGENT_TOKEN=[YOUR-API-KEY]" -p 2790:2790 -p 2799:2799/udp -it raygunowner/raygun-apm:latest

Some useful commands that can be run against the Docker container:

# Get the status of the Raygun Agent
docker exec raygun-agent ./rgc -status

# Get the stats from the Raygun Agent
docker exec raygun-agent ./rgc -debugstats

# Tail the log from the container
docker container logs --tail 100 raygun-agent

The following is an example docker-compose.yml file with the Raygun APM Agent included.

version: '3'

services:
  raygun:
    image: raygunowner/raygun-apm:latest
    ports:
      - "2790:2790"
      - "2799:2799/udp"
    volumes:
      - raygun-agent:/usr/share/Raygun
    environment:
      RAYGUN_AGENT_TOKEN: "[YOUR-API-KEY]"
    tty: true

volumes:
  raygun-agent:

If the agent container is running in the same network as your app (e.g using docker-compose), they should be able to communicate.

If they are not in the same Docker network, you can configure the profiler to send data to a specified host. Depending on which profiler you are using, set one of the following environment variables for your application (the variable needs to be accessible by your app so that the profiler can access it).

  • Ruby profiler:
PROTON_UDP_HOST=<name of the agent container>
  • Node profiler:
RAYGUN_AGENT_HOST=<name of the agent container>
  • .NET profiler:

    When using the .NET profiler, the profiler and agent must be either in the same Docker network or the same container.