telemetry

package
v1.1.8 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package telemetry provides optional error tracking via Sentry.

Error tracking is completely optional and only enabled if SENTRY_DSN environment variable is set. When disabled, all functions are safe no-ops. This is designed for production use without requiring error tracking.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CaptureError

func CaptureError(err error)

CaptureError captures an error in Sentry at the default level if Sentry is initialized. Safe to call even if Sentry is not initialized (no-op in that case).

func CaptureException

func CaptureException(err error, level sentry.Level)

CaptureException captures an exception in Sentry with a specified severity level. Safe to call even if Sentry is not initialized (no-op in that case).

func Close

func Close()

Close flushes any pending events to Sentry with a 2-second timeout. Safe to call even if Sentry is not initialized (no-op in that case). Should be called via defer in main().

func InitSentry

func InitSentry() error

InitSentry initializes Sentry error tracking if SENTRY_DSN environment variable is set. If SENTRY_DSN is not set, this is a no-op. Returns an error only if initialization fails with a configured DSN (not if DSN is missing).

Types

This section is empty.

Jump to

Keyboard shortcuts

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