Aryan Mehrotra
gofr.dev
Open Source India 2026
GoFr: An Opinionated Go Framework
For accelerated microservice development
Where we are
75%
Up from 25% in 2024. Sundar Pichai, April 2026.
84%
Stack Overflow Developer Survey 2025, 49,000+ respondents.
53%
Go Developer Survey 2025, published January 2026.
Sources: Semafor, Stack Overflow, go.dev/blog/survey2025
gofr.dev
What it costs
56%
No better than a year ago. It compiles almost every time.
5x
Pull requests are 51% larger on high-AI teams.
3x
Against 34% more tasks delivered.
46%
33% trust it. 3% trust it highly.
Sources: Veracode 2026, Faros AI 2026 (22,000 developers), Stack Overflow 2025
gofr.dev
The idea
Don't manually wire OpenTelemetry, Prometheus, or structured logging. gofr.New() does it.
Rule 4 of GoFr's guide for AI coding assistants, gofr.dev/AGENTS.md
GoFr v1.62.0
gofr.dev
The whole service
func main() {
app := gofr.New()
app.GET("/orders/{id}", getOrder)
app.Run()
}
func getOrder(c *gofr.Context) (any, error) {
var status string
err := c.SQL.QueryRowContext(c,
"SELECT status FROM orders WHERE id=?",
c.PathParam("id")).Scan(&status)
return status, err
}
Traces. OpenTelemetry spans for the request and the query; one env var ships them.
Metrics. Prometheus at /metrics on port 2121.
Logs. JSON lines carrying the trace_id.
Health. /.well-known/health and /.well-known/alive.
Profiling. pprof on the metrics port.
Shutdown. Graceful on SIGTERM, 30 seconds by default.
The same signature serves HTTP, gRPC, GraphQL, WebSocket, cron and CLI
gofr.dev
AI inside the service
app.AddLLM(&llm.Client{
Provider: llm.Groq,
Model: "llama-3.3-70b-versatile",
})
func ask(c *gofr.Context) (any, error) {
return c.LLM().Generate(c, prompt)
}
Every call is a span in the request's trace.
Requests and tokens per request are Prometheus metrics.
The model counts toward service health, like the database.
OpenAI, Groq, DeepSeek, Together, Ollama, or your own ai.Model. Chat, stream, embed, tools.
gofr.dev
Agents as clients
Any MCP client
app.EnableMCP()
MCP server on 127.0.0.1:8200
Same router, same middleware
Only GET, HEAD, OPTIONS and QUERY routes become tools. Writes are never exposed.
It listens on loopback, on its own port, and you can exclude routes.
Tool calls run through the real router, with the caller's headers forwarded.
MCP is a Linux Foundation project (Agentic AI Foundation) since December 2025
gofr.dev
Live demo
1
curl localhost:8000/inventory/A1
A trace and a metric appear. Nobody asked for them.
2
curl -X POST localhost:8000/ask -d '{"prompt":"..."}'
The LLM call is a span in the same trace, tokens counted.
3
MCP client -> localhost:8200
The agent finds /inventory as a tool and calls it.
Code: examples/using-ai in github.com/gofr-dev/gofr
gofr.dev
For the company
| Pressure | Without a framework | With GoFr |
|---|---|---|
| Review load | Each generated service is wired its own way | One handler signature for HTTP, gRPC, cron and CLI |
| Incidents | Tracing and health checks added after the outage | Traces, metrics, logs and health from gofr.New() |
| AI spend | Token use is invisible until the invoice | Tokens per request is a metric from the first call |
| Integrations | A different client and setup per store | 30+ datasources and brokers through one context |
| Lock-in | A vendor SDK in every service | Apache-2.0, standard net/http, OpenTelemetry |
20,800+ GitHub stars, 160+ contributors, a release every two to three weeks
gofr.dev
The takeaway
HTTP, gRPC, GraphQL, WebSocket, cron jobs, CLI apps, CRUD from a struct
MySQL, Postgres, SQLite, Redis, Mongo, Cassandra, ClickHouse and more, with migrations
Kafka, NATS, Google Pub/Sub, MQTT, SQS, Event Hubs, Redis
Local disk, S3, GCS, Azure, FTP and SFTP behind one file API
Traces, metrics, JSON logs, health endpoints, pprof, live log-level change
Basic auth, API keys, OAuth with JWT, RBAC, rate limiting, CORS
HTTP client with circuit breaker, retry, rate limit and health checks
LLM datasource, streaming, embeddings, tool calls, MCP server
Also: graceful shutdown, Swagger UI, test mocks. All in GoFr v1.62.0, Apache-2.0.
gofr.dev
Start tonight
gofr.dev: docs and quick start
github.com/gofr-dev/gofr: the code, Apache-2.0
gofr.dev/AGENTS.md: hand this to your coding assistant
Aryan Mehrotra · x.com/_aryanmehrotra
Open Source India 2026