Skip to content
This repository has been archived by the owner on Jun 14, 2023. It is now read-only.

Latest commit

 

History

History
45 lines (33 loc) · 776 Bytes

README.md

File metadata and controls

45 lines (33 loc) · 776 Bytes

Go2sky with gear (v1.21.2)

Installation

go get -u github.com/SkyAPM/go2sky-plugins/gear

Usage

package main

import (
	"log"

	"github.com/SkyAPM/go2sky"
	gearplugin "github.com/SkyAPM/go2sky-plugins/gear"
	"github.com/SkyAPM/go2sky/reporter"
	"github.com/teambition/gear"
)

func main() {
    // Use gRPC reporter for production
	re, err := reporter.NewLogReporter()
	if err != nil {
		log.Fatalf("new reporter error %v \n", err)
	}

	defer re.Close()

	tracer, err := go2sky.NewTracer("gear", go2sky.WithReporter(re))
	if err != nil {
		log.Fatalf("create tracer error %v \n", err)
	}

	app := gear.New()
    
	//Use go2sky middleware with tracing
	app.Use(gearplugin.Middleware(tracer))

	// do something
}

See more.