The Datadog Python library
Python Ruby
Clone or download
Latest commit 6ca6c1e Jun 27, 2018

The Datadog Python library

Build Status Documentation Status

Datadogpy is a collection of tools suitable for inclusion in existing Python projects or for development of standalone scripts. It provides an abstraction on top of Datadog's raw HTTP interface and the Agent's StatsD metrics aggregation server, to interact with Datadog and efficiently report events and metrics.

See for changes.


To install from pip:

pip install datadog

To install from source:

python install

Quick Start Guide

# Configure the module according to your needs
from datadog import initialize

options = {


# Use Datadog REST API client
from datadog import api

title = "Something big happened!"
text = 'And let me tell you all about it here!'
tags = ['version:1', 'application:web']

api.Event.create(title=title, text=text, tags=tags)

# Use Statsd, a Python client for DogStatsd
from datadog import statsd

statsd.gauge('foo', 42)

# Or ThreadStats, an alternative tool to collect and flush metrics, using Datadog REST API
from datadog import ThreadStats
stats = ThreadStats()

Thread Safety

DogStatsD and ThreadStats are thread-safe.