Categorygithub.com/ovh/erlenmeyer
modulepackage
0.0.0-20220202092843-82de52efe57b
Repository: https://github.com/ovh/erlenmeyer.git
Documentation: pkg.go.dev

# README

Erlenmeyer: Time Series query translator

Erlenmeyer is a Go Proxy used to parse multiple Open Source TimeSeries DataBase query (OpenTSDB, PromQL, Prometheus-remote_read, InfluxQL and Graphite) . Then they are translated into WarpScript to produce native Warp 10 queries.

Erlenmeyer: Time Series query translator

Building erlenmeyer

You can test and run locally erlenemeyer following those building steps.

Configuration

You can retrieve a config.sample.yml file, that can be re-used to configure erlenmeyer.

cp config.sample.yml /Path/to/erlenmeyer.yaml

In this config file, you will retrieve the Warp10 backend endpoint to set warp_endpoint. Erlenmeyer will use this endpoint to resolve WarpScript generated queries.

Run

Run the dev compiled version:

./build/erlenmeyer --config /Path/to/erlenmeyer.yaml

Erlenmeyer supports some flags as --listen to specify erlenmeyer listen address and --config to specify the config file to use.

More information about the supported flags are provided by executing:

./build/erlenmeyer -h

Supported protocols

NameStateDocumentation
Warp10Nativedoc
PromQLNear fulldoc
Prometheus - Remote-readNear fulldoc
OpenTSDBNear fulldoc
GraphitePartialdoc
InfluxQLNewdoc

Motivation

At OVHcloud, a lot of Metrics users were used to a previous TSDB experience with which they felt confortable and efficient. The goal of Erlenmeyer was to leverage their existing habits, while converging on the Metrics Time Series platform. Hence we decided to welcome customers adding more and more protocols from several Open Source Time Series DB. Under the hood, the Warp10 platform offers the powerful WarpScript query language which was a great help on this process, by just implementing all the query layers as a transpilation step. The best part of it, is now you can have: the same backend, the same data and some Grafana Dashboard written in PromQL when others are using OpenTSDB!

PromQL configuration

Warp10 metrics names can include some characters not available with Prometheus. Erlenmeyer can filter result metrics meta to replace for example . by _. To activate it, you will need to set some of the following configuration keys:

# Enable filter on remote read enpoint
prometheus.remote_read.meta.replace.enabled: true
# Replace all series meta "." by "_"
prometheus.remote_read.meta.replace.map: 
  ".": "_"

# Enable filter on query enpoint only on series classnames
prometheus.query.classname.replace.enabled: true
# Replace all series classname "." by "_"
prometheus.query.classname.replace.map: 
  ".": "_"

# Enable filter on query enpoint only on series labels
prometheus.query.labels.replace.enabled: true
# Replace all series classname "." by "_"
prometheus.query.labels.replace.map: 
  ".": "_"

Status

Erlenmeyer is used in production.

Contributing

Instructions on how to contribute to Erlenmeyer are available on the Contributing page.

Metrics

Erlenmeyer exposes metrics about his usage:

namelabelstypedescription
erlenmeyer_exec_requestapp, token_id, protocolcounterWarp execution count
erlenmeyer_exec_fetched_datapointsapp, token_id, protocolcounterNumber of datapoints fetched
erlenmeyer_exec_opsapp, token_id, protocolcounterNumber of WarpScript operations
erlenmeyer_exec_error_requestapp, token_id, protocolcounterWarp 10 error by user application
erlenmeyer_http_requestcounterNumber of http request handled
erlenmeyer_http_error_requestcounterNumber of http request in error
erlenmeyer_http_status_codestatuscounterCounter per requests status code
erlenmeyer_http_response_timepathcounterRequests response time in nanoseconds
erlenmeyer_protocol_requestprotocolcounterRequests by protocol
erlenmeyer_protocol_error_requestprotocol, statuscounterRequests error by protocol and status
erlenmeyer_graphite_functionfunctioncounterFunction used by user of graphite
erlenmeyer_influxdb_requestfunctioncounterNumber of requests handled
erlenmeyer_influxdb_errorsfunctioncounterNumber of requests in errors
erlenmeyer_influxdb_warningfunctioncounterNumber of errored client requests
erlenmeyer_opentsdb_requestfunctioncounterNumber of requests handled
erlenmeyer_opentsdb_errorsfunctioncounterNumber of requests in errors
erlenmeyer_opentsdb_warningfunctioncounterNumber of errored client requests
erlenmeyer_promql_requestfunctioncounterNumber of requests handled
erlenmeyer_promql_requestfunctioncounterNumber of requests handled

You can enable a basic auth for the /metrics endpoint by adding the following keys in the config file:

metrics.basicauth.enabled: true
metrics.basicauth.user: test
metrics.basicauth.password: $2b$12$hNf2lSsxfm0.i4a.1kVpSOVyBCfIB51VRjgBUyv6kdnyTlgWj81Ay 

The metrics basic auth password needs to be hashed. To do it you can follow the same step as in prometheus basic auth doc:

Create your own local gen-pass.py pyhton file:

import getpass
import bcrypt

password = getpass.getpass("password: ")
hashed_password = bcrypt.hashpw(password.encode("utf-8"), bcrypt.gensalt())
print(hashed_password.decode())

Save it and run it, this should prompt you the hashed password to use for the configuration file.

Licence

Erlenmeyer is released under a 3-BSD clause license.

Get in touch

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author