statsd

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: GPL-3.0 Imports: 8 Imported by: 0

README

metrics/processors/statsd

Import path: github.com/InsideGallery/core/metrics/processors/statsd

This package registers a plain UDP StatsD metrics processor. It writes count, gauge, and timing packets to a configured StatsD address.

Main APIs

  • ProcessorName is the registration name: statsd.
  • New(cfg metrics.Config, service string) creates the processor and is registered from init.

Usage

package main

import (
	_ "github.com/InsideGallery/core/metrics/processors/statsd"

	"github.com/InsideGallery/core/metrics"
)

func newMetrics() (*metrics.Client, error) {
	cfg, err := metrics.GetEnvConfig()
	if err != nil {
		return nil, err
	}

	return metrics.New(cfg, "api")
}

Run with METRICS_PROCESSORS=statsd and configure METRICS_STATSD_ADDR.

Configuration

The package reads the METRICS_STATSD prefix:

  • METRICS_STATSD_ADDR: UDP StatsD address. Required.
  • METRICS_STATSD_NAMESPACE: metric namespace, default ptolemy.

The namespace is trimmed and normalized to include one trailing dot. Metric names are sanitized before writing. Tags are not encoded in StatsD packets by this processor. Distribution values are sent as ms timing packets.

Live integration tests require PTOLEMY_METRICS_STATSD_INTEGRATION=1 and METRICS_STATSD_ADDR.

Documentation

Index

Constants

View Source
const ProcessorName = "statsd"

ProcessorName is the registration name for the StatsD metrics processor.

Variables

This section is empty.

Functions

func New

New creates a plain UDP StatsD metrics processor.

Types

This section is empty.

Jump to

Keyboard shortcuts

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