Documentation ¶
Overview ¶
Package instafiber provides Instana instrumentation for Fiber package.
Example ¶
// (c) Copyright IBM Corp. 2023 //go:build go1.17 // +build go1.17 package main import ( "log" "github.com/gofiber/fiber/v2" instana "github.com/instana/go-sensor" "github.com/instana/go-sensor/instrumentation/instafiber" ) func main() { // Create a sensor for instana instrumentation sensor := instana.NewSensor("my-service") app := fiber.New() // Use the instafiber.TraceHandler for instrumenting the handler app.Get("/greet", instafiber.TraceHandler(sensor, "greet", "/greet", hello)) // Start server log.Fatal(app.Listen(":3000")) } func hello(c *fiber.Ctx) error { return c.SendString("Hello world!") }
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 TraceHandler ¶
func TraceHandler(sensor instana.TracerLogger, routeID, pathTemplate string, handler fiber.Handler) fiber.Handler
TraceHandler adds Instana instrumentation to the route handler
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.