Skip to content

kindrid/txdatadogpy

Repository files navigation

The Datadog Python library

Build StatusDocumentation 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 agent's StatsD metrics aggregation server, to interact with Datadog and efficiently report events and metrics.

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 needsfromdatadogimportinitializeoptions={'api_key':'api_key', 'app_key':'app_key' } initialize(**options) # Use Datadog REST API clientfromdatadogimportapititle="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 DogStatsdfromdatadogimportstatsdstatsd.increment('whatever') statsd.gauge('foo', 42) # Or ThreadStats, an alternative tool to collect and flush metrics, using Datadog REST APIfromdatadogimportThreadStatsstats=ThreadStats() stats.start() stats.increment('home.page.hits')

Threadsafety

DogStatsd and ThreadStats are threadsafe.

About

The Datadog Python library

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python99.9%
  • Ruby0.1%