Getting Started
Installation
Go
go get github.com/telemetrylane/agent
Rust
cargo add telemetrylane
Python
pip install telemetrylane
First Pipeline
Let's create a simple pipeline that collects traces and exports them to stdout.
package main
import (
"context"
"fmt"
"log"
"github.com/telemetrylane/agent"
)
func main() {
// Initialize the agent with stdout exporter
a, err := agent.Init(agent.Config{
ServiceName: "demo-service",
Exporter: "stdout",
})
if err != nil {
log.Fatal(err)
}
defer a.Shutdown(context.Background())
// Start a trace span
ctx, span := a.Trace(context.Background(), "process-order")
// Emit a log within the trace context
a.Log(ctx, agent.Info, "order received", "order_id", "ord-9821")
// Record a metric
a.Metric("orders_processed", 1, agent.Tag("region", "us-east-1"))
span.End()
fmt.Println("Pipeline complete. Check stdout for telemetry output.")
}
When you run this, you'll see output like:
[telemetrylane] trace service=demo-service span=process-order duration=1.204ms
[telemetrylane] log service=demo-service level=info msg="order received" order_id=ord-9821
[telemetrylane] metric service=demo-service name=orders_processed value=1 region=us-east-1
Next Steps
- Learn about Collectors, Routers, and Exporters in the API Reference
- Configure pipelines for OTLP, Jaeger, and Zipkin
- See real-world integration examples