phantomas icon indicating copy to clipboard operation
phantomas copied to clipboard

InfluxData reporter

Open macbre opened this issue 8 years ago • 4 comments

Introduce phantomas-reporter-influxdata

Relates to #593

Integration tests using TravisCI

macbre avatar Apr 06 '16 20:04 macbre

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-<tracked_url>

EFF avatar Apr 07 '16 21:04 EFF

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
  • push all metrics to the same timeserie (with phantomas_ prefix)
  • add an URL of the page as an url tag
  • allow to provide the reporter with a custom tag value (will be reported as tag 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

macbre avatar Apr 08 '16 17:04 macbre

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 avatar May 19 '16 14:05 anlutro

@anlutro, what if we push all metrics as fields in a single measurement?

macbre avatar Nov 24 '16 20:11 macbre