Installation
Install and set up the tracing package
less than a minute
Get started with the Rivaas tracing package by installing it in your Go project.
Requirements
- Go 1.25 or higher - The tracing package uses modern Go features
- OpenTelemetry dependencies - Automatically installed via
go get
Install the Package
Add the tracing package to your Go module:
go get rivaas.dev/tracing
This will download the package and its OpenTelemetry dependencies.
Verify Installation
Create a simple test file to verify the installation:
package main
import (
"context"
"log"
"rivaas.dev/tracing"
)
func main() {
tracer, err := tracing.New(
tracing.WithServiceName("test-service"),
tracing.WithStdout(),
)
if err != nil {
log.Fatal(err)
}
defer tracer.Shutdown(context.Background())
log.Println("Tracing initialized successfully!")
}
Run the test:
go run main.go
You should see a success message with no errors.
Dependencies
The tracing package depends on:
go.opentelemetry.io/otel- OpenTelemetry APIgo.opentelemetry.io/otel/sdk- OpenTelemetry SDKgo.opentelemetry.io/otel/exporters/stdout/stdouttrace- Stdout exportergo.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc- OTLP gRPC exportergo.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp- OTLP HTTP exporter
These are automatically installed when you run go get rivaas.dev/tracing.
Module Setup
If you’re starting a new project, initialize a Go module first:
mkdir my-traced-app
cd my-traced-app
go mod init example.com/my-traced-app
go get rivaas.dev/tracing
Next Steps
Now that you have the package installed:
- Learn Basic Usage to create your first tracer
- Explore Providers to choose the right exporter
- Set up Middleware for automatic HTTP tracing
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.