Installation

Metlo for Golang has two components, the Metlo agent and instrumentation for your specific frameworks(s). To install the Metlo agent, run:

Bash
curl https://metlo-releases.s3.us-west-2.amazonaws.com/metlo_agent_linux_amd64_latest > /usr/local/bin/metlo-agent
chmod +x /usr/local/bin/metlo-agent

After that you have to install the instrumentation for your framework. We currently support the following frameworks:

Gin

Bash
go get github.com/metlo-labs/metlo/ingestors/golang/metlo
go get github.com/metlo-labs/metlo/ingestors/golang/gin

Gorilla/Mux

Bash
go get github.com/metlo-labs/metlo/ingestors/golang/metlo
go get github.com/metlo-labs/metlo/ingestors/golang/gorilla

Setup

Go
import (
    "net/http"
    ...

    "github.com/metlo-labs/metlo/ingestors/golang/metlo"
    <EXPORT_NAME> "github.com/metlo-labs/metlo/ingestors/golang/<FRAMEWORK_NAME>"
)

func main() {
    metlo := metlo.InitMetlo("https://app.metlo.com", "<YOUR_METLO_API_KEY>")
    instrumentation := <EXPORT_NAME>.Init(metlo)

    r.Use(instrumentation.Middleware)
    ...
}