A TimeSeriesQL backend for the AppOptics service
This project adds AppOptics as a backend for the TimeSeriesQL ecosystem.
To get a local copy up and running follow these simple steps.
The requirements are in the requirements.txt file.
pip install timeseriesql-appoptics
- Clone the timeseriesql-appoptics
git clone https:://github.com/mbeale/timeseriesql-appoptics.git
- Install library
cd timeseriesql-appoptics
python setup.py install
Appoptics is a commercial time series database product. The backend converts a query into an API call.
The backend expects a APPOPTICS_TOKEN
environment variable to be set in order to authenticate to AppOptics.
from timeseriesql_appoptics import AOBackend
data = AOBackend(x for x in "metric.name")['1h'] #basic
data = AOBackend(x * 100 for x in "metric.name")['1h'] #binary operations (+, -, /, *)
data = AOBackend(x * 1.8 + 32 for x in "metric.name")['1h'] #multiple binary operations (°C to °F)
data = AOBackend(x.max for x in "metric.name")[3600:] #get max value
Currently only ==
and !=
are supported.
from timeseriesql_appoptics import AOBackend
data = AOBackend(x for x in "metric.name" if x.environment == 'production')[3600:]
from timeseriesql_appoptics import AOBackend
data = AOBackend(x for x in "metric.name").group('environment')[3600:]
data = AOBackend(x - y for x,y in AOBackend((x.max for x in "metric1"), (x.min for x in "metric2")).by('tag1'))[3600:]
from timeseriesql_appoptics import AOBackend
data = AOBackend(x for x in "metric.name")[:] #no start or end time (not recommended)
data = AOBackend(x for x in "metric.name")[3600:] #from now - 3600 seconds until now, resolution of 1
data = AOBackend(x for x in "metric.name")[3600:1800] #from now - 3600 seconds until now - 1800 seconds, resolution of 1
data = AOBackend(x for x in "metric.name")[3600::300] #from now - 3600 seconds until now resoultion of 300 seconds
data = AOBackend(sum(derive(x)) for x in "metric.name")[3600:] #get the sums of the derivatives
data = AOBackend(zero_fill(x) for x in "metric.name")[3600::60] #zero_fill
data = AOBackend('s("some_metric", "*")')[3600:]
See the open issues for a list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
Michael Beale - michael.beale@gmail.com
Project Link: https://github.com/mbeale/timeseriesql-appoptics