Set metric sampler using environment variable or system property

Description

By default all metrics are assigned to the 'default' sampler.
The metrics.xml file allows assigning metrics to different samplers (e.g. 'high' to sample at higher rate, 'off' to disable sampling for a metric).
It's sometimes useful to set a metric sampler directly from command line, without editing the metrics.xml file.
This improvement allows setting a metric sampler via environment variable (with 'GS_METRIC_' prefix) or system property (with 'com.gs.metric' prefix).

For example, to disable all 'os' metrics, but sample 'os_memory' metrics at low rate:
GS_METRIC_OS=off
GS_METRIC_OS_MEMORY=low

Acceptance Test

Verified manually

Assignee

Niv Ingberg

Reporter

Niv Ingberg

Labels

None

Priority

Minor

SalesForce Case ID

None

Fix versions

Commitment Version/s

None

Due date

None

Product

None

Edition

Open Source

Platform

All
Configure