Skip to content

HadhemiDD/datadogpy

This branch is 375 commits behind DataDog/datadogpy:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

e7b744e · Feb 21, 2019
Feb 21, 2019
Feb 14, 2019
Nov 29, 2018
Sep 21, 2016
Mar 11, 2015
Jan 15, 2019
Nov 29, 2018
Apr 3, 2015
Mar 11, 2015
Oct 30, 2018
Jan 11, 2019
Mar 11, 2015
Jan 15, 2019
Feb 5, 2019

Repository files navigation

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

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.

About

The Datadog Python library

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 99.9%
  • Ruby 0.1%