Skip to main content

The Datadog Python library

Project description

The Datadog Python library

Build Status Documentation Status PyPI - Version PyPI - Downloads

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.

For usage of StatsD metrics, the Agent must be running and available.

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

# Uncomment to set namespace or add tags to everything
# statsd.namespace = 'localdev'
# statsd.constant_tags = ['testing', 'dogstats']

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.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
datadog-0.27.0-py2.py3-none-any.whl (70.6 kB) Copy SHA256 hash SHA256 Wheel py2.py3
datadog-0.27.0.tar.gz (71.8 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page