Help us shape the future of Go! Take the 2026 Go Developer Survey

diagnostics

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package diagnostics stores bounded classifications, never raw log messages or attributes.

Index

Constants

View Source
const ServiceName = "diagnostics.collector"

Variables

This section is empty.

Functions

func Categories

func Categories() []string

Categories returns every error-inventory category in display order.

func Migrations

func Migrations() fs.FS

func RegisterCategory

func RegisterCategory(name, before string)

RegisterCategory adds an error-inventory category for a downstream module: error logs whose message starts with "name:" or "name " are filed under it. It is listed right before the category before (at the end when before is empty or unknown). Registering a known name again does nothing.

Types

type Collector

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

func New

func New(d *sql.DB) *Collector

func (*Collector) Close

func (c *Collector) Close()

func (*Collector) Dropped

func (c *Collector) Dropped() uint64

func (*Collector) Handler

func (c *Collector) Handler(base slog.Handler) slog.Handler

func (*Collector) LastSuccessfulWrite

func (c *Collector) LastSuccessfulWrite() time.Time

func (*Collector) List

func (c *Collector) List(ctx context.Context, f Filter) ([]Row, error)

func (*Collector) Start

func (c *Collector) Start()

func (*Collector) StorageFailures

func (c *Collector) StorageFailures() uint64

type Filter

type Filter struct {
	Category, Since, Until string
	HTTPStatus, Limit      int
}

type Row

type Row struct {
	Category, Code, FirstAt, LastAt string
	HTTPStatus                      int
	Count                           int64
}

Jump to

Keyboard shortcuts

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