monitoring

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package monitoring contains helpers for application monitoring. Currently configured to use sentry.

Index

Constants

This section is empty.

Variables

View Source
var Flags = flag.Flags{
	&flag.Boolean{
		Name:        "monitoring-disabled",
		Usage:       "Disables application monitoring",
		EnvVar:      "MONITORING_DISABLED",
		Destination: &config.disabled,
		Hidden:      true,
	},
	&flag.String{
		Name:        "monitoring-environment",
		Usage:       "Environment to use when writing to application monitoring",
		EnvVar:      "MONITORING_ENVIRONMENT",
		Destination: &config.environment,
		Value:       "development",
		Hidden:      true,
	},
	&flag.String{
		Name:        "monitoring-dsn",
		Usage:       "DSN to use for sending reports to sentry",
		EnvVar:      "MONITORING_DSN",
		Destination: &config.dsn,
		Hidden:      true,
	},
}

Flags contains all command-line flags that can be used to configure monitoring.

Functions

func New

func New() (io.Closer, error)

New creates a new instance of the Monitor type and sets up the connection to the monitoring provider.

func WithError

func WithError(err error) error

WithError reports an error to the provider.

Types

type Monitor

type Monitor struct {
	// contains filtered or unexported fields
}

The Monitor type is responsible for maintaining the lifetime of the connection to the application monitoring provider. It implements io.Closer and should be closed on application exit.

func (*Monitor) Close

func (m *Monitor) Close() error

Close the connection to the monitoring provider.

Jump to

Keyboard shortcuts

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