Skip to main content

CLI utility that queries SQL database and posts results to StatsD.

Project description

# sql2statsd

`sql2statsd` is a CLI utility that queries SQL database and posts results to
[StatsD](https://github.com/etsy/statsd)
based on a provided YAML config file and a job name.


## Installation

`virtualenv` recommended.

- From Github:
```
pip install -e git+https://github.com/Suenweek/sql2statsd#egg=sql2statsd
```


## Usage
`sql2statsd` is intended to be run as a scheduled task (e.g. a `cron` job).

1. Create a YAML config file based on a config schema provided below.
2. Run `sql2statsd --config-file <CONFIG_FILE> <JOB_NAME>` where:
- `<CONFIG_FILE>` is a path to your config.
- `<JOB_NAME>` is a key in a `config["jobs"]` section.

Passing config file path as a parameter each time is tedious, so you may want
to specify `SQL2STATSD_CONFIG_FILE` env var instead.


## Config schema

```yaml
db_servers:
<str>: # Database server name
host: <str>
port: <int>
user: <str>
password: <str>

stats_servers:
<str>: # Stats server name
host: <str>
port: <int>

jobs:
<str>: # Job name
db_server: <str> # Database server name
db_name: <str>
stats_server: <str> # Stats server name
stat: <str>
query: <str>
```

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

sql2statsd-0.0.1-py2.py3-none-any.whl (4.0 kB view hashes)

Uploaded Python 2 Python 3

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