fdb-document-layer
fdb-document-layer copied to clipboard
Prometheus plugin
Right now, Document Layer
does not have any other metric reporting plugin other than the default ConsoleMetric
reporter which simply log the metrics to TraceFiles
, which is an FDB specific logging infrastructure. Thus we want a new metric plugin that is more familiar to the community. Prometheus has picked up a lot of momentum during recent years so we would go with that.
Thanks to the design, providing a new metric reporting plugin is easy:
- First either write your own cpp Prometheus client code, or use the semi-official one here. §
- Then simply wrap the client code around the IMetric interface.
- Finally, when start up the
DocLayer
process, tell it to load the plugin library by passing in the--metric_plugin
and--metric_plugin_config
arguments.
We think this will benefit the community in many ways.
§ When using/creating the client code, keep in mind that DocLayer is written in Flow
, whose model has only one process and one thread running on a giant event loop. And thus the plugin code must NOT be blocking.