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

README

fastlog/handlers/datadog

Import path: github.com/InsideGallery/core/fastlog/handlers/datadog

This package registers the datadog fastlog output. It builds a Datadog slog handler using the Datadog API client and the slog-datadog adapter.

Main APIs

  • OutKind is the registry key: datadog.

The handler factory is registered from init, so most consumers use this package as a blank import or through fastlog/all.

Usage

package main

import (
	_ "github.com/InsideGallery/core/fastlog/handlers/datadog"

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

func configureLogging() error {
	cfg, err := fastlog.GetConfigFromEnv()
	if err != nil {
		return err
	}

	return fastlog.SetupDefaultLogger(cfg)
}

Run with LOG_OUTPUTS=datadog:json. The registry format field is ignored because this package registers a complete handler factory.

Configuration

The package reads the DATADOG prefix:

  • DATADOG_HOST: parsed by config; the current handler uses os.Hostname() for the emitted hostname.
  • DATADOG_SERVICE: service name sent to Datadog.
  • DATADOG_ENDPOINT: Datadog site, default datadoghq.eu.
  • DATADOG_API_KEY: API key.
  • DATADOG_TIMEOUT: API timeout, default 5s.
  • DATADOG_LEVEL: handler level, default INFO.

Live integration tests require PTOLEMY_FASTLOG_DATADOG_INTEGRATION=1 and DATADOG_API_KEY.

Documentation

Index

Constants

View Source
const OutKind = "datadog"

OutKind is the registry key for the datadog handler.

Variables

This section is empty.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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