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 CHANGELOG.md for changes.

Installation

To install from pip:

pip install datadog

To install from source:

python setup.py install

Quick Start Guide

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

options = {
    'api_key':'api_key',
    'app_key':'app_key'
}

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.increment('whatever')
statsd.gauge('foo', 42)

# Or ThreadStats, an alternative tool to collect and flush metrics, using Datadog REST API
from datadog import ThreadStats
stats = ThreadStats()
stats.start()
stats.increment('home.page.hits')

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.

Source Distribution

datadog-0.27.0.tar.gz (71.8 kB view details)

Uploaded Source

Built Distribution

datadog-0.27.0-py2.py3-none-any.whl (70.6 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file datadog-0.27.0.tar.gz.

File metadata

  • Download URL: datadog-0.27.0.tar.gz
  • Upload date:
  • Size: 71.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.20.0 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.5

File hashes

Hashes for datadog-0.27.0.tar.gz
Algorithm Hash digest
SHA256 9487480fd4b5898b665384f95eeb0cbca4ec998bb58224b7bb60fff3978191ad
MD5 0912e3c59fce11fbfa7299b50b15943d
BLAKE2b-256 4a986a6120bb29e1039522ae2e64c2c6d83764fba3ec769eed654766e262c989

See more details on using hashes here.

File details

Details for the file datadog-0.27.0-py2.py3-none-any.whl.

File metadata

  • Download URL: datadog-0.27.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 70.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.20.0 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.5

File hashes

Hashes for datadog-0.27.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d28251dd28f51f27e942bb23fe15349e5223aef75246a94ff7233fb174b74bb9
MD5 878173d622f852499bed7cb258ce3bc5
BLAKE2b-256 a67367870db4011a209aa05111e1e9e7f54031072bb2a74e8026ce68a3a6de37

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page