Open macbre opened 8 years ago
good idea !
@macbre how did you imagine that one ? write every metric to a single serie ? write a single point to multiple series where every metric correspond to a serie ? or you might want to be super flexible which I don't really recommend ...
What I would do is write each metric as a point to a single serie where the serie could be a parameter and defaults to phantomas-
Let's try the following approach:
database: phantomas
name: phantomas_<serie name>
tags: metric=<metric name>,url=<url>,tag=<optional tag value>
fields: value=125.64 1434055562000000000
phantomas_
prefix)url
tagtag
tag)https://docs.influxdata.com/influxdb/v1.1/introduction/getting_started/
https://docs.influxdata.com/influxdb/v1.1/concepts/schema_and_data_layout/:
Every InfluxDB use case is special and your schema will reflect that uniqueness. There are, however, general guidelines to follow and pitfalls to avoid when designing your schema.
- Encode meta data in tags Tags are indexed and fields are not indexed. This means that queries on tags are more performant than those on fields. In general, your queries should guide what gets stored as a tag and what gets stored as a field:
- Store data in tags if they’re commonly-queried meta data
- Store data in tags if you plan to use them with GROUP BY()
- Store data in fields if you plan to use them with an InfluxQL function
- Store data in fields if you need them to be something other than a string - tag values are always interpreted as strings
Use https://github.com/node-influx/node-influx
npm install --save influx@next
Integration tests: https://github.com/crodas/InfluxPHP/blob/master/.travis.yml
I suggest pushing more than one metric into the same measurement, if those metrics are related, as that makes it possible to easily do maths on them (for example, subtract one loading time from another).
@anlutro, what if we push all metrics as fields in a single measurement?
Introduce
phantomas-reporter-influxdata
Relates to #593
Integration tests using TravisCI