# README
Instana instrumentation for Microsoft Azure Functions
This module contains the instrumentation code for Microsoft Azure functions written in Go that uses the custom runtime.
Installation
To add github.com/instana/go-sensor/instrumentation/instaazurefunction
to your go.mod
file, from your project directory
run:
$ go get github.com/instana/go-sensor/instrumentation/instaazurefunction
Usage
Instrumenting a custom handler
To instrument a custom handler, wrap it with instaazurefunction.WrapFunctionHandler()
before passing
it to the http router.
func handlerFn(w http.ResponseWriter, r *http.Request) {
// ...
}
func main() {
// Initialize a new collector.
collector := instana.InitCollector(&instana.Options{
Service: "my-azf-collector",
})
// Instrument your handler before passing it to the http router.
http.HandleFunc("/api/azf-test", instaazurefunction.WrapFunctionHandler(collector, handlerFn))
}
Refer the instaazurefunction
package documentation for more details.
Limitations
- The instrumentation supports only HTTP and Queue trigger types.
- The instrumentation cannot support HTTP triggers if
enableForwardingHttpRequest
is set totrue
in thehost.json
file.
# Functions
WrapFunctionHandler wraps the http handler and add instrumentation data for the specified handlers.
# Constants
Version is the instrumentation module semantic version.