Fluo 1.2.0 documentation >> Administration >> Metrics
A Fluo application can be configured (in fluo-app.properties) to report metrics. When metrics are configured, Fluo will report some ‘default’ metrics about an application that help users monitor its performance. Users can also write code to report ‘application-specific’ metrics from their applications. Both ‘application-specific’ and ‘default’ metrics share the same reporter configured by fluo-app.properties and are described in detail below.
Fluo metrics are not published by default. To publish metrics, configure a reporter in the ‘metrics’ section of fluo-app.properties. There are several different reporter types (i.e Console, CSV, Graphite, JMX, SLF4J) that are implemented using Dropwizard. The choice of which reporter to use depends on the visualization tool used. If you are not currently using a visualization tool, there is documentation at end of this page for reporting Fluo metrics to Grafana/InfluxDB.
When Fluo metrics are reported, they are published using a naming scheme that encodes additional
information. This additional information is represented using all caps variables (i.e
Default metrics start with
fluo.system and have following naming schemes:
Application metrics start with
fluo.app and have following scheme:
The variables below describe the additional information that is encoded in metrics names.
APPLICATION- Fluo application name
REPORTER_ID- Unique ID of the Fluo oracle, worker, or client that is reporting the metric. When running in YARN, this ID is of the format
INSTANCE_IDcorresponds to instance number. When not running in YARN, this ID consists of a hostname and a base36 long that is unique across all fluo processes.
METRIC- Name of the metric. For ‘default’ metrics, this is set by Fluo. For ‘application’ metrics, this is set by user. Name should be unique and avoid using period ‘.’ in name.
CLASS- Name of Fluo observer or loader class that produced metric. This allows things like transaction collisions to be tracked per class.
Default metrics report for a particular Observer/Loader class or system-wide.
Below are metrics that are reported from each Observer/Loader class that is configured in a Fluo
application. These metrics are reported after each transaction and named using the format
<STATUS>) a transaction can terminate
Below are system-wide metrics that are reported for the entire Fluo application. These metrics are
named using the format
Histograms and Timers have a counter. In the case of a histogram, the counter is the number of times
the metric was updated and not a sum of the updates. For example if a request for 5 timestamps was
made to the oracle followed by a request for 3 timestamps, then the count for
would be 2 and the mean would be (5+3)/2.
Following the instructions below to set this up:
Add the following to your InfluxDB configuration to configure it accept metrics in Graphite format from Fluo. The configuration below contains templates that transform the Graphite metrics into a format that is usable in InfluxDB.
[[graphite]] bind-address = ":2003" enabled = true database = "fluo_metrics" protocol = "tcp" consistency-level = "one" separator = "_" batch-size = 1000 batch-pending = 5 batch-timeout = "1s" templates = [ "fluo.class.*.*.*.*.* ..app.host.measurement.observer.field", "fluo.class.*.*.*.* ..app.host.measurement.observer", "fluo.system.*.*.*.* ..app.host.measurement.field", "fluo.system.*.*.* ..app.host.measurement", "fluo.app.*.*.* ..host.measurement.field", "fluo.app.*.* ..host.measurement", ]
Fluo distributes a file called
fluo_metrics_setup.txt that contains a list of commands that
setup InfluxDB. These commands will configure an InfluxDB user, retention policies, and
continuous queries that downsample data for the historical dashboard in Grafana. Run the command
below to execute the commands in this file:
$INFLUXDB_HOME/bin/influx -import -path $FLUO_HOME/contrib/influxdb/fluo_metrics_setup.txt
fluo-app.properties of your Fluo application to send Graphite metrics to InfluxDB.
Below is example configuration. Remember to replace
<INFLUXDB_HOST> with the actual host.
fluo.metrics.reporter.graphite.enable=true fluo.metrics.reporter.graphite.host=<INFLUXDB_HOST> fluo.metrics.reporter.graphite.port=2003 fluo.metrics.reporter.graphite.frequency=30
The reporting frequency of 30 sec is required if you are using the provided Grafana dashboards that are configured in the next step.
Grafana needs to be configured to load dashboard JSON templates from a directory. Fluo
distributes two Grafana dashboard templates in its tarball distribution in the directory
contrib/grafana. Before restarting Grafana, you should copy the templates from your Fluo
installation to the
dashboards/ directory configured below.
[dashboards.json] enabled = true path = <GRAFANA_HOME>/dashboards
If you restart Grafana, you will see the Fluo dashboards configured but all of their charts will be empty unless you have a Fluo application running and configured to send data to InfluxDB. When you start sending data, you may need to refresh the dashboard page in the browser to start viewing metrics.