golang-apm-http

module
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2024 License: Apache-2.0

README

golang-apm-http

go get github.com/middleware-labs/golang-apm-http


package main

import (
	 "net/http"
	  track "github.com/middleware-labs/golang-apm/tracker"
          mwhttp "github.com/middleware-labs/golang-apm-http/http"
)

func hello(w http.ResponseWriter, req *http.Request) {
    fmt.Fprintf(w, "hello\n")
}

func main() {
     go track.Track(
        track.WithConfigTag("service", "your service name"),
        track.WithConfigTag("projectName", "your project name"),
        track.WithConfigTag("accessToken", "your access token"),
     )
     http.Handle("/hello", mwhttp.MiddlewareHandler(http.HandlerFunc(hello), "hello"))
     http.ListenAndServe(":8090", nil)	
}


Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL