datadog

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: 7 Imported by: 0

README

metrics/processors/datadog

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

This package registers the Datadog DogStatsD metrics processor. It sends count, gauge, and distribution metrics through github.com/DataDog/datadog-go/v5/statsd.

Main APIs

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

Usage

package main

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

	"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=datadog and configure an address.

Configuration

The package reads the METRICS_DATADOG prefix:

  • METRICS_DATADOG_ADDR: DogStatsD address. Required unless DD_STATSD_ADDR is set.
  • METRICS_DATADOG_NAMESPACE: metric namespace, default ptolemy.
  • DD_STATSD_ADDR: legacy fallback address when METRICS_DATADOG_ADDR is blank.

The namespace is trimmed and normalized to include one trailing dot. The processor adds a service:<service> tag at client construction and forwards per-metric tags unchanged.

Live integration tests require PTOLEMY_METRICS_DATADOG_INTEGRATION=1 and one address variable.

Documentation

Index

Constants

View Source
const ProcessorName = "datadog"

ProcessorName is the registration name for the Datadog metrics processor.

Variables

This section is empty.

Functions

func New

func New(_ metrics.Config, service string) (metrics.Processor, error)

New creates a Datadog DogStatsD 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