Health check endpoints
New in v0.2.11: Golf now supports sophisticated health and readiness check endpoints with custom logic, Kubernetes compatibility, and flexible response formats.
/health) and readiness (/ready) endpoints with customizable logic.
Modern approach (recommended)
Create custom health and readiness check files in your project root to implement sophisticated monitoring logic.Custom health check
Createhealth.py in your project root for liveness probes:
GET /health
Custom readiness check
Createreadiness.py in your project root for readiness probes:
GET /ready
Response format options
1. JSONResponse with status codes (recommended)
2. Structured dictionary (auto-converted)
HTTP status code guidelines
For Kubernetes health probes:- HTTP 200: Service is healthy/ready - continue normal operation
- HTTP 503: Service is unhealthy/not ready - restart container or remove from load balancer
Default behavior
When custom files don’t exist but health checks are enabled via configuration:- Readiness endpoint:
GET /readyreturns{"status": "pass"}(HTTP 200) - Health endpoint:
GET /healthreturns plain text “OK” (configurable)
Legacy configuration (deprecated)
Troubleshooting
Common issues
Files not copied to build:- Ensure
health.py/readiness.pyare in project root, same level asgolf.json
- Verify files have valid Python syntax and include a
check()function
- Use
JSONResponseobjects for explicit status code control
Telemetry
Golf introduces comprehensive telemetry capabilities through automatic OpenTelemetry integration and enhanced instrumentation.Overview
Golf’s telemetry system provides:- OpenTelemetry integration - Configurable distributed tracing
- Detailed tracing - For tools, resources, prompts, and Golf utilities
- Input/output capture - Safe serialization of request and response data
- Configurable detail levels - Control what gets traced and monitored
OpenTelemetry configuration
Basic configuration
Configure OpenTelemetry in yourgolf.json:
Detailed tracing (optional)
By default, Golf captures basic telemetry like execution timing, success/failure rates, and error information. You can optionally enable detailed tracing to capture input and output data:- Tool Input/Output - Function parameters and return values
- Resource Content - Resource parameters and returned data
- Golf Utilities - Full elicitation prompts/responses and sampling conversations
- Request Context - Complete request metadata and session information
- Detailed tracing may capture sensitive user data
- Recommended only for development and testing environments
- Uses safe serialization with size limits to prevent issues
- Can be disabled in production while keeping basic telemetry active