Home

Awesome

Bookstore REST API using Gin and Gorm

Read this article on understand how to build a sample golang app using Gin and Gorm.

To run and configure app to send data to SigNoz:

SERVICE_NAME=goApp INSECURE_MODE=true OTEL_EXPORTER_OTLP_ENDPOINT=<IP of SigNoz backend>:4317 go run main.go

<IP of SigNoz backend:4317> should be without http/https scheme. Eg localhost:4317

This runs the gin application at port 8090. Try accessing API at http://localhost:8090/books

Below are the apis available to play around. The API calls will generate telemetry data which will be sent to SigNoz which can be viewed at <IP of SigNoz backend>:3000

GET    /books                    
GET    /books/:id               
POST   /books                    
PATCH  /books/:id                
DELETE /books/:id                

Instrumentation Packages

The OpenTelemetry registry is the best place to discover instrumentation packages. It will include packages outside of this project.

The following instrumentation packages are provided for popular Go packages and use-cases.

Instrumentation PackageMetricsTraces
github.com/astaxie/beego
github.com/aws/aws-sdk-go-v2
github.com/bradfitz/gomemcache
github.com/emicklei/go-restful
github.com/gin-gonic/gin
github.com/go-kit/kit
github.com/gocql/gocql
github.com/gorilla/mux
github.com/labstack/echo
github.com/Shopify/sarama
go.mongodb.org/mongo-driver
google.golang.org/grpc
gopkg.in/macaron.v1
host
net/http
net/http/httptrace
runtime

Follow Opentelemetry docs for examples on latest otel releases: Opentelemetry-go