Cache most recent valid metrics
C M4 Shell Makefile
Switch branches/tags
Nothing to show
Clone or download
EldoreiJK Merge pull request #39 from bstepankova/master
Problem: config file cannot be loaded
Latest commit f416d36 Jul 18, 2018
Permalink
Failed to load latest commit information.
builds Problem: We need to integrate fty-common-logging. Jul 17, 2018
doc Regenerated zproject with current latest templates, applying recent r… Jun 4, 2018
include Problem: config file cannot be loaded Jul 18, 2018
packaging Problem: We need to integrate fty-common-logging. Jul 17, 2018
src Unify the logging interface. Jul 17, 2018
.clang-format
.editorconfig Update project.xml to our recent standards and regenerate zproject Dec 4, 2017
.gitattributes
.gitignore Regenerated zproject with current latest templates, applying recent r… Jun 4, 2018
.travis.yml Problem: We need to integrate fty-common-logging. Jul 17, 2018
Jenkinsfile Problem: We need to integrate fty-common-logging. Jul 17, 2018
Makefile.am Use fty-common-logging interface instead of custom logger. Jul 17, 2018
README.md Problem : GET request doesn't manage regex Feb 3, 2018
autogen.sh Regenerate with recent zproject Mar 19, 2017
ci_build.sh Problem: We need to integrate fty-common-logging. Jul 17, 2018
ci_deploy.sh Problem: project has to be regenerated Jan 6, 2017
ci_deploy_obs.sh Regenerate with current zproject; update reference to fty_proto, czmq… Jun 9, 2017
configure.ac Problem: We need to integrate fty-common-logging. Jul 17, 2018
install.xml Problem: fix naming and tmpfiles config Apr 10, 2017
license.xml license.xml : Promote to (C) 2018 Jun 3, 2018
project.xml Use fty-common-logging interface instead of custom logger. Jul 17, 2018

README.md

fty-metric-cache

Agent fty-metric-cache serves as in-memory cache of most recent metrics.

How to build

To build fty-metric-cache project run:

./autogen.sh
./configure
make
make check # to run self-test

How to run

To run fty-metric-cache project:

  • from within the source tree, run:
./src/fty-metric-cache

For the other options available, refer to the manual page of fty-metric-cache

  • from an installed base, using systemd, run:
systemctl start fty-metric-cache

Agent also has a command line interface fty-metric-cache-cli.

For further information, refer to the manual page of fty-metric-cache-cli.

Configuration file

Configuration file - fty-metric-cache.cfg - is currently ignored.

Agent reads environment variable BIOS_LOG_LEVEL to set verbosity level.

Agent has a state file stored in /var/lib/fty/fty-metric-cache/state_file.

Architecture

Overview

fty-metric-cache has 1 actor:

  • fty-metric-cache-server: main actor

It also has one built-in timer, which runs every 30 seconds and deletes outdated metrics from the cache.

Protocols

Published metrics

Agent doesn't publish any metrics.

Published alerts

Agent doesn't publish any alerts.

Mailbox requests

Agent fty-metric-cache can be requested for:

  • listing devices with (some) metrics available

  • getting metrics for specified device

List devices with (some) metrics available

The USER peer sends the following message using MAILBOX SEND to FTY-METRIC-CACHE-SERVER ("fty-metric-cache") peer:

  • zuuid/LIST - request list of devices with (some) metrics available

where

  • '/' indicates a multipart string message
  • subject of the message MUST be "latest-rt-data".

The FTY-METRIC-CACHE-SERVER peer MUST respond with this message back to USER peer using MAILBOX SEND.

  • zuuid/OK/LIST/devices

where

  • '/' indicates a multipart frame message
  • 'devices' is a string of device names separated by newline
  • subject of the message MUST be "latest-rt-data".

Get current metrics for specified asset

The USER peer sends the following message using MAILBOX SEND to FTY-METRIC-CACHE-SERVER ("fty-metric-cache") peer:

  • zuuid/GET/element/[filter] - request current metrics for asset 'element'

where

  • '/' indicates a multipart string message
  • 'element' MUST be name of existing asset or a regex about asset name
  • 'filter' is an optional parameter which filter as a regex type of metric
  • subject of the message MUST be "latest-rt-data".

The FTY-METRIC-CACHE-SERVER peer MUST respond with this message back to USER peer using MAILBOX SEND.

  • zuuid/OK/GET/element/metric-1/.../metric-n

where

  • '/' indicates a multipart frame message
  • 'metric-1',...,'metric-n' are ALL the current metrics (with valid TTL) available for 'element'
  • subject of the message MUST be "latest-rt-data".

Stream subscriptions

Agent is subscribed to METRICS stream.

Received metrics are stored into local cache.