analytics

package
v0.9.0-rc4 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultEndpoint is the default address for the analytics collector.
	DefaultEndpoint = "otlp.ncps.dev:443"
)

Variables

This section is empty.

Functions

func NewResource added in v0.6.3

func NewResource(
	ctx context.Context,
	serviceName,
	serviceVersion,
	schemaURL string,
	extraAttrs ...attribute.KeyValue,
) (*resource.Resource, error)

NewResource creates a new OpenTelemetry resource with standard attributes but WITHOUT hostname and process owner to preserve anonymity.

func SafeGo added in v0.6.1

func SafeGo(ctx context.Context, fn func())

Types

type Reporter

type Reporter interface {
	GetLogger() log.Logger
	GetMeter() metric.Meter
	LogPanic(context.Context, any, []byte)
	Shutdown(context.Context) error
	WithContext(context.Context) context.Context
}

func Ctx added in v0.6.1

func Ctx(ctx context.Context) Reporter

func New added in v0.6.1

func New(
	ctx context.Context,
	db database.Querier,
	res *resource.Resource,
	reportingSamples bool,
) (Reporter, error)

New initializes the analytics reporting pipeline. It returns a shutdown function that should be called when the application exits.

Jump to

Keyboard shortcuts

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