-
Notifications
You must be signed in to change notification settings - Fork 1
Reporters
foxx-tracer-collector has a simple plugin mechanism through which external reporters can be added and configured. This lets you use an external reporter designed for your specific endpoint even when it does not come bundled with the collector itself.
The collector comes with two reporters pre-installed:
- A noop reporter that does nothing. This reporter is baked in and cannot be removed, but it can be disabled.
- A console reporter that prints traces to the ArangoDB log. This reporter is pluggable and can be removed or disabled if required.
Pluggable reporters can be found by searching the NPM registry for the keyword "foxx-tracer-reporter". At the time of this writing, there is a production-ready reporter available for the Datadog Cloud Monitoring Service service. It is named foxx-tracer-reporter-datadog.
foxx-tracer-collector uses Grunt as its build tool, and reporters are also managed by Grunt tasks. To add a reporter, execute the following:
npx grunt reporter:add --pkg=<reporter-package-name> --namespace=<reporter-key>
When this command has finished running, the reporter plugin in the package reporter-package-name
is installed under node_modules
, package.json
gets updated, and an entry is made in 2 places using the provided reporter-key
:
- An entry in
reporters.json
- A file present in the top-level project root folder that informs the collector about what reporters are available and under what key to search for their configuration in the manifest. - An entry in the
configuration
object inmanifest.json
- This entry is prefixed with the termreporters-
to minimize chances of collision with other configuration keys. If for example you providedatadog
as the key, then the corresponding manifest configuration key becomesreporters-datadog
. The contents of this setting object is provided by the reporter plugin being installed.
To remove an installed reporter, execute the following:
npx grunt reporter:remove --namespace=<reporter-key>
The reporter-key
is key in reporters.json
under which this reporter is registered. Executing this command performs the following actions:
- The reporter is uninstalled from
node_modules
. -
package.json
gets updated. - The reporter's entry is removed from
reporters.json
. - The reporter's entry is removed from the manifest's
configuration
object.