Knowledge Base

cancel
Showing results for 
Search instead for 
Did you mean: 

Extensions Commons Library - Metric Transformers

Table of Contents

Introduction

Configuration

Alias

Multiplier

Delta

Convert

 

Introduction

The Java Extension SDK provides an automated utility that allows extensions developers to transform a metric name and value as it would be represented in the Metric Browser. These transformers include the following:

  1. Alias
  2. Multiplier
  3. Delta
  4. Convert

 

Configuration

In the metrics.xml, the transformers should be specified in the following manner.

 

   <stat url="/nitro/v1/stat/lbvserver" rootElement="lbvserver" alias="Load Balancing Server Metrics">
        <metric attr="cursrvrconnections" alias="Server Connections"/>
        <metric attr="memoryInMBytes" alias="Memory in KB" multiplier="1000"/>
        <metric attr="throughput" delta="true" />
        <metric attr="state">
            <convert str="DOWN" value="0"/>
            <convert str="UP" value="1"/>
            <convert str="UNKNOWN" value="2"/>
        </metric>
    </stat>

 

In the config.yml, the transformers should be specified in the following manner.

 

metrics:
     - name: “cursrvrconnections”
       alias: “Cursor RV Connections”
       delta: true
       multiplier: 1000
       convert: 
         “DOWN”: 0
         “UP”: 1
         “UNKNOWN”: 2

 

 

Note that multiple transformers can be applied to the same metric as follows:

 

 <metric attr="cursrvrconnections" alias="Server Connections" multiplier="10" delta="true"/>

 

Please note the following:

  1. It is not mandatory to specify any of these transformers.
  2. By default, a metric does not have an alias and will be named as is from the artifact being monitored.
  3. The default value for the multiplier is always 1.
  4. The default value for the delta is always false.
  5. A metric that yields text values will simply be skipped if a convert transformer isn’t specified.

 

On calling transformAndPrintMetrics(List<Metric> metrics) in com.appdynamics.extensions.MetricWriteHelper, the SDK automatically applies any configured transformers before publishing these metrics.

 

Alias

The Alias transformer can be used to replace a metric’s name. Often, metrics are represented by ambiguous names in the artifacts being monitored, as evident in the example above. In this case, cursrvrconnections will be represented as Server Connections in the Metric Browser.

 

Multiplier

The Multiplier transformer can be used to multiply the original metric value by a configured factor. From the example above, consider that an artifact returns memory in MB and a requirement is to monitor this metric in KB. A multiplier of 1000 can be applied to this metric to satisfy this requirement.

 

Delta

Consider an ever-increasing metric value and a requirement is to monitor the number of units by which this metric increases every minute. A Delta transformer can be applied in this case. This transformer compares the value of a metric at minute X with its value at minute X-1 and publishes the difference as a metric value.

 

Note: Everytime the extension is run, the first value will not be reported if delta is true.

 

Convert

The Convert transformer can be applied to metrics that return a text value from an artifact’s API. These text values can be represented as numeric values. From the example above, DOWN will be represented with a value of 0, UP with 1 and UNKNOWN with 2 for the state metric.

Version history
Revision #:
3 of 3
Last update:
‎01-22-2019 01:56 PM
Updated by:
 
Labels (1)
0 Kudos