Local Docker Setup
A Raygun local environment, which offers only a subset of the features but can speed up local development, can be set up using a Docker image located at raygunowner/raygun-aspire-portal:latest
. This allows for faster feedback loops, ease of testing error reporting, and integration into local services without depending on external networks.
note: Raygun local version only supports Crash Reporting.
Setting Up with Docker
To set up a local Raygun environment, follow these steps using the Docker Compose configuration provided below:
- Pull the required Docker images.
- Set up a connection to the Ollama AI model to enable AI Error Resolution.
- Run the following
docker-compose
YAML file, which can be started by runningdocker compose up
in the terminal:
version: '3.8'
services:
raygun-aspire-portal:
image: raygunowner/raygun-aspire-portal:latest
container_name: raygun_local_dev
environment:
- ConnectionStrings__Ollama=http://ollama-service:11434
ports:
- "8080:8080"
restart: always
depends_on:
- ollama-service # Ensure Ollama service starts before this container
ollama-service:
image: ollama/ollama:latest
container_name: ollama_local_aier
restart: always
Configuring Raygun Provider for Development
The Raygun provider needs to be set up so that it switches between the local and production API endpoints depending on the environment.
For example, in C# using the Raygun4Net provider, this is how it can be configured:
// Add Raygun
RaygunClient raygunClient = new(new RaygunSettings()
{
ApiKey = "YOUR_API_KEY",
CatchUnhandledExceptions = true, // Enable to log all unhandled exceptions
ApiEndpoint = app.Environment.IsDevelopment() ? new Uri("http://localhost:8080/Ingestion/Entries") : new Uri("https://api.raygun.com/entries")
});
Limitations of the Local Version
Please note that the Raygun local version only supports Crash Reporting but not Real User Monitoring or Application Performance Monitoring.
The local version is based on the Raygun for Aspire system but removes the dependency on Aspire, requiring only Docker to run.
Contributing to Raygun Open-Source Projects
Raygun's local environment is open-source, and contributions are encouraged. If you want to contribute or explore the project further, check out the following repositories:
- Raygun for Aspire
- Aspire Presentation Demo
- Raygun.Aspire.Hosting.Raygun
- Raygun.Aspire.Hosting.Ollama
By contributing to these projects, you'll be helping to enhance Raygun's local and remote monitoring capabilities.