Apitally SDK for Go
March 22, 2026 ยท View on GitHub
API monitoring & analytics made simple
Metrics, logs, traces, and alerts for your APIs โ with just a few lines of code.
Apitally SDK for Go
Apitally is a simple API monitoring and analytics tool that makes it easy to understand API usage, monitor performance, and troubleshoot issues. Get started in minutes by just adding a few lines of code. No infrastructure changes required, no dashboards to build.
Learn more about Apitally on our ๐ website or check out the ๐ documentation.
Key features
API analytics
Track traffic, error and performance metrics for your API, each endpoint and individual API consumers, allowing you to make informed, data-driven engineering and product decisions.
Request logs
Drill down from insights to individual API requests or use powerful search and filters to find specific requests. View correlated application logs and traces for a complete picture of each request, making troubleshooting faster and easier.
Error tracking
Understand which validation rules in your endpoints cause client errors. Capture error details and stack traces for 500 error responses, and have them linked to Sentry issues automatically.
API monitoring & alerts
Get notified immediately if something isn't right using custom alerts, synthetic uptime checks and heartbeat monitoring. Alert notifications can be delivered via email, Slack and Microsoft Teams.
Supported frameworks
This SDK requires Go 1.21 or higher.
| Framework | Supported versions | Setup guide |
|---|---|---|
| Chi | v5 | Link |
| Echo | v4, v5 | Link |
| Fiber | v2, v3 | Link |
| Gin | v1 | Link |
Apitally also supports many other web frameworks in JavaScript, Python, .NET and Java via our other SDKs.
Getting started
If you don't have an Apitally account yet, first sign up here. Then create an app in the Apitally dashboard. You'll see detailed setup instructions with code snippets you can copy and paste. These also include your client ID.
See the SDK reference for all available configuration options, including how to mask sensitive data, customize request logging, and more.
Chi
Add the SDK to your dependencies:
go get github.com/apitally/apitally-go/chi-v5
Then add the Apitally middleware to your application:
import (
apitally "github.com/apitally/apitally-go/chi-v5"
"github.com/go-chi/chi/v5"
)
func main() {
r := chi.NewRouter()
config := apitally.NewConfig("your-client-id")
config.Env = "dev" // or "prod" etc.
r.Use(apitally.Middleware(r, config))
// ... rest of your code ...
}
For further instructions, see our setup guide for Chi.
Echo
Add the SDK to your dependencies:
go get github.com/apitally/apitally-go/echo-v4 # for Echo v4
go get github.com/apitally/apitally-go/echo-v5 # for Echo v5
Then add the Apitally middleware to your application:
import (
apitally "github.com/apitally/apitally-go/echo-v4" // or echo-v5
"github.com/labstack/echo/v4" // or echo/v5
)
func main() {
e := echo.New()
config := apitally.NewConfig("your-client-id")
config.Env = "dev" // or "prod" etc.
e.Use(apitally.Middleware(e, config))
// ... rest of your code ...
}
For further instructions, see our setup guide for Echo.
Fiber
Add the SDK to your dependencies:
go get github.com/apitally/apitally-go/fiber-v2 # for Fiber v2
go get github.com/apitally/apitally-go/fiber-v3 # for Fiber v3
Then add the Apitally middleware to your application:
import (
apitally "github.com/apitally/apitally-go/fiber-v2" // or fiber-v3
"github.com/gofiber/fiber/v2" // or fiber/v3
)
func main() {
app := fiber.New()
config := apitally.NewConfig("your-client-id")
config.Env = "dev" // or "prod" etc.
app.Use(apitally.Middleware(app, config))
// ... rest of your code ...
}
For further instructions, see our setup guide for Fiber.
Gin
Add the SDK to your dependencies:
go get github.com/apitally/apitally-go/gin
Then add the Apitally middleware to your application:
import (
apitally "github.com/apitally/apitally-go/gin"
"github.com/gin-gonic/gin"
)
func main() {
r := gin.Default()
config := apitally.NewConfig("your-client-id")
config.Env = "dev" // or "prod" etc.
r.Use(apitally.Middleware(r, config))
// ... rest of your code ...
}
For further instructions, see our setup guide for Gin.
Getting help
If you need help please create a new discussion on GitHub or email us at support@apitally.io. We'll get back to you as soon as possible.
License
This library is licensed under the terms of the MIT license.