observability

package module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: MIT Imports: 18 Imported by: 0

README

Usage

In main():

ctx := context.Background()
app, shutdown := NewLogrusAndTraceAwareFiberApp(ctx, "mailgun-api")
[...]
SafeShutdown(app.Listen(":8080"), shutdown(ctx))

And then inside the request handlers:

logger := GetLogger(c)

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GCPProjectID = getGcpProjectID()

This operation is expensive, so do it once on start up which will be fine for any GCP deployments.

Functions

func GetLogger

func GetLogger(c *fiber.Ctx) *logrus.Entry

func NewLogrusAndTraceAwareFiberApp

func NewLogrusAndTraceAwareFiberApp(ctx context.Context, serviceName string) (*fiber.App, func(context.Context) error)

func SafeShutdown

func SafeShutdown(errs ...error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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