go run cmd/server/main/go
curl http://localhost:8080/health
curl http://localhost:8080/api/v1/metrics | python3 -m json.tool
curl http://localhost:8080/api/v1/metrics/mrr
curl http://localhost:8080/api/v1/catalog
curl http://localhost:8080/api/v1/datasources | python3 -m json.tool
curl -X POST http://localhost:8080/api/v1/metrics
-H "Content-Type: application/json"
-d '{
"name": "total_customers",
"display_name": "Total Customers",
"description": "Total number of customers",
"sql_expression": "SELECT COUNT(*) as value FROM customers",
"return_type": "count",
"depends_on": ["customers.id"],
"tags": ["customers"]
}'
curl -X POST http://localhost:8080/api/v1/metrics/mrr/resolve \
curl -X POST http://localhost:8080/api/v1/metrics/total_revenue/resolve
-H "Content-Type: application/json"
-d '{
"filters": [
{"column": "status", "operator": "=", "value": "completed"},
{"column": "created_at", "operator": ">", "value": "2024-01-01"}
]
}'
curl http://localhost:8080/api/v1/metrics/mrr/info
curl -X POST http://localhost:8080/api/v1/metrics/validate
-H "Content-Type: application/json"
-d '{
"name": "test_metric",
"display_name": "Test Metric",
"sql_expression": "SELECT COUNT(*) FROM nonexistent_table",
"return_type": "count",
"depends_on": ["nonexistent_table.id"]
}'
curl -X POST http://localhost:8080/api/v1/metrics/validate
-H "Content-Type: application/json"
-d '{
"name": "customer_count",
"display_name": "Total Customer Count",
"sql_expression": "SELECT COUNT(*) as value FROM customers",
"return_type": "count",
"depends_on": ["customers.id"]
}'
curl -X POST http://localhost:8080/api/v1/metrics/total_revenue/resolve
-H "Content-Type: application/json"
-d '{
"filters": [
{"column": "status", "operator": "IN", "value": ["completed", "pending"]}
]
}'
go test ./... -v