Production exception monitoring and debugging for Julia applications with AI-powered auto-fix capabilities.
- Julia 1.6 or higher
- Internet connectivity to AIVory backend
using Pkg
Pkg.add(url="https://github.com/aivory/aivory-monitor-julia")using Pkg
Pkg.develop(path="/path/to/monitor-agents/agent-julia")Add to your application's entry point:
using AIVoryMonitor
# Initialize at startup
AIVoryMonitor.init(
api_key=ENV["AIVORY_API_KEY"],
environment="production"
)
# Your application code
function main()
# ... your code ...
end
main()try
risky_operation()
catch e
AIVoryMonitor.capture_exception(e)
rethrow(e)
endThe agent automatically registers an atexit hook to capture uncaught exceptions:
using AIVoryMonitor
AIVoryMonitor.init(api_key=ENV["AIVORY_API_KEY"])
# Uncaught exceptions will be automatically captured and reported
error("This will be captured and sent to AIVory")Configure the agent via environment variables or init() parameters:
| Variable | Description | Default |
|---|---|---|
AIVORY_API_KEY |
Agent authentication key | Required |
AIVORY_BACKEND_URL |
Backend WebSocket URL | wss://api.aivory.net |
AIVORY_ENVIRONMENT |
Environment name (production, staging, dev) | production |
AIVORY_SAMPLING_RATE |
Exception sampling rate (0.0-1.0) | 1.0 |
AIVORY_MAX_DEPTH |
Variable capture depth for context | 3 |
export AIVORY_API_KEY="your-api-key-here"
export AIVORY_ENVIRONMENT="staging"
export AIVORY_SAMPLING_RATE="0.5"
julia your_app.jlAIVoryMonitor.init(
api_key="your-api-key",
backend_url="wss://api.aivory.net",
environment="production",
sampling_rate=1.0,
max_depth=3
)The agent captures exceptions through two mechanisms:
-
Automatic capture via
Base.atexit: Registers a global exit handler that captures uncaught exceptions before the Julia process terminates. -
Manual capture via
try/catch: Wrap risky code blocks and explicitly callcapture_exception(e)to report exceptions while continuing execution.
- Uses HTTP.jl for WebSocket communication with the AIVory backend
- Authenticates via API key (query parameter or header)
- Sends exception payloads as JSON with full stack traces
- Captures local variable state at each stack frame (up to
max_depth)
Each captured exception includes:
- Exception type and message
- Full stack trace with file paths and line numbers
- Local variables at each frame (limited by
max_depth) - System information (Julia version, OS, hostname)
- Environment name and timestamp
- Correlation IDs for distributed tracing
Problem: Exceptions are not appearing in the AIVory dashboard.
Solutions:
- Verify
AIVORY_API_KEYis set correctly - Check network connectivity to
wss://api.aivory.net - Enable debug logging:
ENV["AIVORY_DEV_MODE"] = "true" - Verify Julia version is 1.6 or higher:
versioninfo()
Problem: Package installation fails due to dependency conflicts.
Solutions:
- Update Julia packages:
Pkg.update() - Check compatibility with
Pkg.status() - Use a fresh Julia environment:
Pkg.activate(".")
Problem: Agent is slowing down application.
Solutions:
- Reduce sampling rate:
AIVORY_SAMPLING_RATE=0.1 - Decrease capture depth:
AIVORY_MAX_DEPTH=1 - Only capture specific exceptions manually instead of using the global handler
Problem: Stack traces are incomplete or missing local variables.
Solutions:
- Ensure exceptions are thrown with full context:
throw(ErrorException(...)) - Increase
max_depthto capture more variable state - Check that code is not compiled with optimizations that remove debug info
See LICENSE in the repository root.
- Documentation: https://aivory.net/monitor/
- Issues: https://github.com/aivory/aivory-monitor/issues
- Email: support@aivory.net