Documentation ¶
Overview ¶
Package instaazurefunction provides Instana tracing instrumentation for Microsoft Azure Functions
Example (Handler) ¶
This example demonstrates how to instrument a custom handler for Azure Functions
// (c) Copyright IBM Corp. 2023 package main import ( "net/http" instana "github.com/instana/go-sensor" "github.com/instana/go-sensor/instrumentation/instaazurefunction" ) // This example demonstrates how to instrument a custom handler for Azure Functions func main() { // Initialize a new sensor. sensor := instana.NewSensor("my-azf-sensor") // Instrument your handler before passing it to the http router. http.HandleFunc("/api/azf-test", instaazurefunction.WrapFunctionHandler(sensor, handlerFn)) } func handlerFn(w http.ResponseWriter, r *http.Request) { // ... }
Output:
Index ¶
Examples ¶
Constants ¶
View Source
const Version = "0.17.0"
Version is the instrumentation module semantic version
Variables ¶
This section is empty.
Functions ¶
func WrapFunctionHandler ¶
func WrapFunctionHandler(sensor instana.TracerLogger, handler http.HandlerFunc) http.HandlerFunc
WrapFunctionHandler wraps the http handler and add instrumentation data for the specified handlers
Types ¶
type Metadata ¶
type Metadata struct { //queueStorage fields DequeueCount int `json:"DequeueCount,string"` PopReceipt string `json:"PopReceipt"` InsertionTime string `json:"InsertionTime"` //http fields Headers struct { UserAgent string `json:"User-Agent"` } `json:"Headers"` //common info with method name Sys struct { MethodName string `json:"MethodName"` } `json:"sys"` }
Click to show internal directories.
Click to hide internal directories.