The Avid Connector API exposes internal metrics like operation duration, message size and many more. The metrics are automatically send to the platform. The platform can be configured to expose the metrics into different backends like Graphite or CloudWatch.
In some cases it is not enough to know the duration of a operation and a service developer feels the need to measure specific parts of her business logic. The Avid Connector API exposes for that reason a Metrics API.
Here are some examples of how to use the Metrics API:
var bal = require('proxy-bal');
- Prefix metric names to prevent possible clashes with core metrics (.eg. iam, asset)
- Dots are path in target systems like Graphite. Try to design you metric names in order to make it easy to capture e.g. all mongo queries with a wild card.
- Good: iam.mongo.query.findPrinciple, iam.mongo.query.deletePrincipleByName
- Bad: iam.mongo.query.find.principle, iam.mongo.query.delete.principle.by.name
- Do not use unbound values like UUID in metric names. Metrics with unbound names are expensive to aggregate and to store.
In most cases you don't have to worry about the metrics tag but if you have a deployment where you must run multiple instances of the same service on the same host machine you must make sure that metrics of each instance are unique by defining the ACS_METRICS_TAG environment variable.
Here is a naming example if you have to run 3 instances of the transcode service on the same host: