new SignalFxMetricsReporter(signalFxClient [, options])
Parameters:
Name | Type | Argument | Description |
---|---|---|---|
signalFxClient |
SignalFxClient | The configured signal fx client. |
|
options |
ReporterOptions |
<optional> |
See ReporterOptions. |
Extends
Members
-
<protected> _defaultDimensions :Dimensions
-
Map of default dimensions, that should be sent with every metric.
Type:
- Inherited From:
- Source:
-
<protected> _defaultReportingIntervalInSeconds :number
-
The default reporting interval, a number in seconds.
If not overridden via the {@see ReporterOptions}, defaults to 10 seconds.Type:
- number
- Inherited From:
- Source:
-
<protected> _log :Logger
-
Loggers to use, defaults to a new console logger if nothing is supplied in options
Type:
- Logger
- Inherited From:
- Source:
-
<protected> _resetMetricsOnInterval :boolean
-
Flag to indicate if metrics should be reset on each reporting interval.
If not overridden via the {@see ReporterOptions}, defaults to false.Type:
- boolean
- Inherited From:
- Source:
-
<protected> _unrefTimers :boolean
-
Flag to indicate if reporting timers should be unref'd.
If not overridden via the {@see ReporterOptions}, defaults to false.Type:
- boolean
- Inherited From:
- Source:
Methods
-
<protected> _getDimensions(metric)
-
Parameters:
Name Type Description metric
MetricWrapper The Wrapped Metric Object.
- Inherited From:
- Source:
Returns:
The left merged default dimensions with the metric specific dimensions
- Type
- Dimensions
-
<protected> _getValuesToProcessForCounter(name, counter)
-
Maps values from a Counter to a set of metrics to report to SigFx.
Parameters:
Name Type Description name
string The registry name
counter
Counter The data from the measure metric object
Returns:
Returns an array of MetricValueTypeWrapper to use to build the request
- Type
- Array.<MetricValueTypeWrapper>
-
<protected> _getValuesToProcessForGauge(name, gauge)
-
Maps values from a Gauge to a set of metrics to report to SigFx.
Parameters:
Name Type Description name
string The registry name
gauge
Gauge The Gauge
Returns:
Returns an array of MetricValueTypeWrapper to use to build the request
- Type
- Array.<MetricValueTypeWrapper>
-
<protected> _getValuesToProcessForHistogram(name, histogram)
-
Maps and Filters values from a Histogram to a set of metrics to report to SigFx.
Parameters:
Name Type Description name
string The registry name
histogram
Histogram The Histogram
Returns:
Returns an array of MetricValueTypeWrapper to use to build the request
- Type
- Array.<MetricValueTypeWrapper>
-
<protected> _getValuesToProcessForTimer(name, timer)
-
Maps and Filters values from a Timer to a set of metrics to report to SigFx.
Parameters:
Name Type Description name
string The registry name
timer
Timer The Timer
Returns:
Returns an array of MetricValueTypeWrapper to use to build the request
- Type
- Array.<MetricValueTypeWrapper>
-
<protected> _getValuesToProcessForType(name, metric)
-
Maps Measured Metrics Object JSON outputs to their respective signal fx metrics using logic from
com.signalfx.codahale.reporter.AggregateMetricSenderSessionWrapper in the java lib to derive namingParameters:
Name Type Description name
string The registered metric base name
metric
Metric The metric.
Returns:
an array of MetricValueTypeWrapper that can be used to
build the SignalFx data point request- Type
- Array.<MetricValueTypeWrapper>
-
<protected> _processMetric(metric, currentBuiltRequest)
-
Method for getting raw signal fx api request values from the Timer Object.
Parameters:
Name Type Description metric
MetricWrapper metric The Wrapped Metric Object.
currentBuiltRequest
any The signal fx request that is being built.
Returns:
the currentBuiltRequest The signal fx request that is being built with the given metric in it.
- Type
- any
-
<protected> _reportMetrics(metrics)
-
Sends metrics to signal fx, converting name and dimensions and Metric to data signal fx can ingest
Parameters:
Name Type Description metrics
Array.<MetricWrapper> The array of metrics to send to signal fx.
-
reportMetricOnInterval(metricKey, intervalInSeconds)
-
Informs the reporter to report a metric on a given interval in seconds.
Parameters:
Name Type Description metricKey
string The metric key for the metric in the metric registry.
intervalInSeconds
number The interval in seconds to report the metric on.
- Inherited From:
- Source:
-
sendEvent(eventType [, category] [, dimensions] [, properties] [, timestamp])
-
Function exposes the event API of Signal Fx.
See https://github.com/signalfx/signalfx-nodejs#sending-events for more details.Parameters:
Name Type Argument Description eventType
string The event type (name of the event time series).
category
SignalFxEventCategoryId <optional>
the category of event. See module:SignalFxEventCategories. Value by default is USER_DEFINED.
dimensions
Dimensions <optional>
a map of event dimensions, empty dictionary by default
properties
Object.<string, string> <optional>
a map of extra properties on that event, empty dictionary by default
timestamp
number <optional>
a timestamp, by default is current time.
Example
const { SignalFxSelfReportingMetricsRegistry, SignalFxMetricsReporter, SignalFxEventCategories } = require('measured-signalfx-reporter'); const registry = new SignalFxSelfReportingMetricsRegistry(new SignalFxMetricsReporter(signalFxClient)); registry.sendEvent('uncaughtException', SignalFxEventCategories.ALERT);
-
setRegistry(registry)
-
Sets the registry, this must be called before reportMetricOnInterval.
Parameters:
Name Type Description registry
DimensionAwareMetricsRegistry - Inherited From:
- Source:
-
shutdown()
-
Clears the intervals that are running to report metrics at an interval, and resets the state.
- Inherited From:
- Source: