• Home
  • Extend Dynatrace
  • Extensions
  • Reference
  • Json reference
  • Extension JSON explained

Extension JSON explained

The plugin.json is your extension definition. Starting with the metrics used by the extension to the favicon and extension configuration fields.

Logically, it can be divided into four parts:

  • Metadata
  • UI
  • Metrics
  • Configuration

Example:

json
{ "name": "custom.remote.python.example", "version": "1.17", "productiveMinVersion": "1.000", "requiredAgentVersion": "1.000", "type": "python", "entity": "CUSTOM_DEVICE", "metricGroup": "tech.Example_Service", "technologies": ["EXAMPLE_SERVICE"], "source": { "package": "demo_activegate_plugin_multi", "className": "RemoteExamplePlugin", "install_requires": ["requests>=2.6.0"], "activation": "Remote" }, "ui": { "keymetrics": [ { "key": "databases.table_size", "aggregation": "max", "mergeaggregation": "sum", "displayname": "Total table size" } ], "keycharts": [ { "group": "Service state", "title": "State", "series": [ { "key": "service.state_5", "displayname": "Status", "seriestype": "bar", "statecolors": ["#ff3333", "#ffd633", "#00b33c"], "statechart": true } ] }, { "group": "Disk usage", "title": "Total disk usage", "series": [ { "key": "databases.table_size", "displayname": "Sum of databases size", "seriestype": "area", "color": "#74cff7" } ] } ], "charts": [ { "group": "Memory", "title": "Per table usage", "series": [ { "key": "databases.table_size", "displayname": "Per table size", "seriestype": "area", "color": "#74cff7", "metricexplanation": "How big is each table" } ] }, { "group": "Entries", "title": "Total num entries", "series": [ { "key": "databases.total_num_entities", "displayname": "Total number of entries", "seriestype": "line", "color": "#74cff7", "metricexplanation": "How big is each table" } ] }, { "group": "Entries", "title": "Archives", "series": [ { "key": "databases.replicated_entries", "displayname": "Number of entries archived", "seriestype": "bar", "color": "#74cff7", "metricexplanation": "Number of metrics moved to archive" } ] }, { "group": "Connections", "title": "Archives", "series": [ { "key": "service.querries_per_second", "displayname": "Connections per second", "seriestype": "bar", "color": "#74cff7", "metricexplanation": "Connections per second" } ] } ] }, "metrics": [ { "statetimeseries": { "key": "service.state_5", "states": ["DOWNTIME", "MAINTENANCE", "WORKING"], "displayname": "Service State", "source": { "state_entrypoint": "/api/state" } }, "entity": "CUSTOM_DEVICE" }, { "timeseries": { "key": "service.querries_per_second", "unit": "PerSecond", "displayname": "Querries per second", "aggregation": "AVG" }, "entity": "CUSTOM_DEVICE_GROUP", "alert_settings": [ { "alert_id": "custom_connections_alert", "event_type": "AVAILABILITY_EVENT", "event_name": "No connections!", "description": "The {metricname} of {severity} is {alert_condition} the threshold of {threshold}", "threshold": 0.01, "alert_condition": "ABOVE", "samples": 5, "violating_samples": 1, "dealerting_samples": 5 } ] }, { "timeseries": { "key": "databases.table_size", "unit": "MegaByte", "displayname": "Table size", "aggregation": "MAX", "dimensions": ["table_name"] }, "entity": "CUSTOM_DEVICE" }, { "timeseries": { "key": "databases.total_num_entities", "unit": "Count", "displayname": "Total num ", "aggregation": "MAX" }, "entity": "CUSTOM_DEVICE" }, { "timeseries": { "key": "databases.replicated_entries", "unit": "Count", "displayname": "Archived Entries", "aggregation": "SUM" }, "entity": "CUSTOM_DEVICE" } ], "properties": [ { "key": "url", "type": "String" }, { "key": "auth_user", "type": "String" }, { "key": "auth_password", "type": "Password" }, { "key": "state_interval", "type": "Integer", "defaultValue": 60 }, { "key": "alert_interval", "type": "Integer", "defaultValue": 360 }, { "key": "event_interval", "type": "Integer", "defaultValue": 240 }, { "key": "relative_interval", "type": "Integer", "defaultValue": 60 } ], "configUI": { "displayName": "CustomCloudTechnology", "properties": [ { "key": "url", "displayName": "URL", "displayOrder": 3, "displayHint": "http://localhost:9200/" }, { "key": "auth_user", "displayName": "User", "displayOrder": 1, "displayHint": "Leave empty if no authentication is set up" }, { "key": "auth_password", "displayName": "Password", "displayOrder": 2, "displayHint": "Leave empty if no authentication is set up", "defaultValue": "somepassword" }, { "key": "state_interval", "displayName": "State change interval", "displayOrder": 3, "displayHint": "How often state metrics changes", "defaultValue": 60 }, { "key": "alert_interval", "displayName": "Alert interval", "displayOrder": 4, "displayHint": "How often an alert is raised", "defaultValue": 360 }, { "key": "event_interval", "displayName": "Event interval", "displayOrder": 5, "displayHint": "How often an event is raised", "defaultValue": 240 }, { "key": "relative_interval", "displayName": "Relative interval", "displayOrder": 6, "displayHint": "How often relative metric is submitted", "defaultValue": 60 } ] } }

Metadata

The top-level metadata section contains a list of properties used to identify your extension.

plugin.json top level

FieldTypeRequiredDescriptionValidation
namestringTrueA unique plugin name in Java package format.minLength: 1, pattern: ^custom.remote.python.([a-zA-Z][a-zA-Z0-9_-]*)+$
versionstringTrueThe plugin version, must be updated whenever the plugin definition is updated.pattern: ^\d+.\d+(.\d+)?$
technologiesarray of stringsTrueType of technology that plugin monitors, as can be viewed on Technologies overview page.
faviconstringFalselink to favicon that should be used on technology tile
entitystringTrueEntity type upon which the plugin is activatedenum: ['CUSTOM_DEVICE', 'CUSTOM_DEVICE_GROUP']
metricGroupstringTrueMetric group is used for grouping custom metrics into a hierarchical namespace where different sources, for example multiple plugins can contribute. Moreover, metric group becomes primary part of metric key. Hence once defined it could not be changed.minLength: 1, pattern: ^(/?[-a-zA-Z0-9_.]+)+$
sourceobjectFalsePython metadata used by ActiveGate PluginModule python engine
metricsarrayTrueThe section defining metrics; see Metrics section for referenceuniqueItems: True
propertiesarray of objectsFalseConfiguration properties the plugin can accept.
uiobjectFalseThis part of the JSON defines how metrics are charted on each Process page.
configUIobjectFalseThe configUI section defines the configuration fields that are displayed in the UI.

Source

The source section lists the package name and class that is to be imported and executed by ActiveGate. This corresponds to the name of the Python file that contains the code and the name of the class that’s defined in it. This information is required by the ActiveGate Plugin Module Python engine.

json
{ "package": "remote_example", "className": "RemoteExamplePlugin", "install_requires": ["requests>=2.6.0"] }

Source metadata section

FieldTypeRequiredDescriptionValidation
packagestringTruePython package that has plugin class
classNamestringTrueName of plugins main python class. Must inherit from BasePlugin.
install_requiresarray of stringsFalseRelates to Python packaging, see: https://setuptools.readthedocs.io/en/latest/setuptools.html#declaring-dependencies
packagesarray of stringsFalseRelates to Python packaging, see: https://docs.python.org/3.8/distutils/setupscript.html
package_dataarray of stringsFalseRelates to Python packaging, see: https://docs.python.org/3.8/distutils/setupscript.html
modulesarray of stringsFalseRelates to Python packaging, see: https://docs.python.org/3.8/distutils/setupscript.html

Technologies and favicon

The technologies and favicon properties determine how your technology is presented on the Technology overview page. To have the data from your extension displayed on an existing technology tile, set a corresponding technology name. You can look up the configured technology names in the ActiveGate extensions JSON reference or you can get them from the UI as the Main technology process property.

If a value of the technologies property doesn't map to an existing one, the extension will create a new tile on the Technology overview page. The Favicon property determines the technology tile displayed on the page:

ActiveGate Plugins Tech Overview

Version

You can't deploy the same extension version twice. To upload a modified extension, make sure you increment the extension version with every build or upload.

Name

ActiveGate extension name should follow ^ custom.remote.python (\.[a-zA-Z0-9_]+)+$ regex. For example, custom.remote.python.demo. The name of each extension must be unique.

Metric Group

The preferred way of using Metric Group is adding prefix "tech" before your metric group definition. For example "tech.elasticsearch". Thanks to this, other users will be able to find additional metrics alongside with others in the context of technology like in this example on Custom Charts page:

Technology metric group

MetricGroup field can be also used to create a completely new entry. Note that you can use dots to create subgroups, like in this example "My_Metrics.plugins":

Technology metric group

However, setting metricGroup field is not necessary for already running extensions that originally didn't have is set. In such a case, metricGroup will be automatically set the extension name not to break the continuity of your data.

UI

This part of the JSON defines how metrics are charted on the Dynatrace page. It contains an optional charts section and an optional keycharts section.

Example UI section:

json
{ "ui": { "keymetrics": [ { "key": "databases.table_size", "aggregation": "max", "mergeaggregation": "sum", "displayname": "Total table size" } ], "keycharts": [ { "group": "Service state", "title": "State", "series": [ { "key": "service.state_5", "displayname": "Status", "seriestype": "bar", "statecolors": ["#ff3333", "#ffd633", "#00b33c"], "statechart": true } ] }, { "group": "Disk usage", "title": "Total disk usage", "series": [ { "key": "databases.table_size", "displayname": "Sum of databases size", "seriestype": "area", "color": "#74cff7" } ] } ], "charts": [ { "group": "Memory", "title": "Per table usage", "series": [ { "key": "databases.table_size", "displayname": "Per table size", "seriestype": "area", "color": "#74cff7", "metricexplanation": "How big is each table" } ] }, { "group": "Entries", "title": "Total num entries", "series": [ { "key": "databases.total_num_entities", "displayname": "Total number of entries", "seriestype": "line", "color": "#74cff7", "metricexplanation": "How big is each table" } ] }, { "group": "Entries", "title": "Archives", "series": [ { "key": "databases.replicated_entries", "displayname": "Number of entries archived", "seriestype": "bar", "color": "#74cff7", "metricexplanation": "Number of metrics moved to archive" } ] }, { "group": "Connections", "title": "Archives", "series": [ { "key": "service.querries_per_second", "displayname": "Connections per second", "seriestype": "bar", "color": "#74cff7", "metricexplanation": "Connections per second" } ] } ] } }

PluginJSONUI

UI Section

FieldTypeRequiredDescriptionValidation
keyMetricsarray of objectsFalsemaxItems: 2
keychartsarray of objectsFalseCharts in first chart group in CD instance
chartsarray of objectsFalseVisible in CD instance, in it's own defined group

KeyMetrics

The KeyMetrics section is optional and allows you to define up to two metrics that should be part of the Custom Device infographic.

json
{ "keymetrics": [ { "key": "databases.table_size", "aggregation": "max", "mergeaggregation": "sum", "displayname": "Total table size" } ] }

Here is an example of a keymetric in web UI:

KeyMetricCD

A keymetric has the following attributes:

keyMetrics

Array item definition:

FieldTypeRequiredDescriptionValidation
keystringTrueminLength: 1
aggregationstringFalseAggregation typeenum: ['MIN', 'MAX', 'AVG', 'SUM', 'COUNT', 'P50', 'P90', 'min', 'max', 'avg', 'sum', 'count', 'p50', 'p90', 'Min', 'Max', 'Avg', 'Sum', 'Count']
mergeaggregationstringFalseenum: ['MIN', 'MAX', 'AVG', 'SUM', 'min', 'max', 'avg', 'sum', 'Min', 'Max', 'Avg', 'Sum']
displaynamestringFalseminLength: 1
unitstringFalseenum: ['NanoSecond', 'MicroSecond', 'MilliSecond', 'Second', 'Byte', 'KiloByte', 'KibiByte', 'MegaByte', 'MebiByte', 'BytePerSecond', 'BytePerMinute', 'KiloBytePerSecond', 'KiloBytePerMinute', 'KibiBytePerSecond', 'KibiBytePerMinute', 'MegaBytePerSecond', 'MegaBytePerMinute', 'MebiBytePerSecond', 'MebiBytePerMinute', 'Ratio', 'Percent', 'Promille', 'Count', 'PerSecond', 'PerMinute', 'Unspecified', 'NotApplicable']

KeyCharts

Both KeyCharts and Charts have the same object structure, for example:

json
{ "keycharts": [ { "group": "Service state", "title": "State", "series": [ { "key": "service.state_5", "displayname": "Status", "seriestype": "bar", "statecolors": ["#ff3333", "#ffd633", "#00b33c"], "statechart": true } ] }, { "group": "Disk usage", "title": "Total disk usage", "series": [ { "key": "databases.table_size", "displayname": "Sum of databases size", "seriestype": "area", "color": "#74cff7" } ] } ] }

Keycharts are visible on each Process page:

KeyChartsCD_location

Charts

Other charts are available after drilling down to the Further details section of each Process page.

UI Charts location

ChartsCD

Both chart and keychart sections are an array of objects:

Chart

Array item definition:

FieldTypeRequiredDescriptionValidation
titlestringTrueminLength: 1
descriptionstringFalseminLength: 1
groupstringTrueminLength: 1
seriesarray of objectsTrue

Where series is an array of objects:

series

Array item definition:

FieldTypeRequiredDescriptionValidation
keystringTrueminLength: 1
colorstringFalse
aggeragationstringFalseenum: ['MIN', 'MAX', 'AVG', 'SUM', 'COUNT', 'P50', 'P90', 'min', 'max', 'avg', 'sum', 'count', 'p50', 'p90', 'Min', 'Max', 'Avg', 'Sum', 'Count']
mergeaggregationstringFalseenum: ['MIN', 'MAX', 'AVG', 'SUM', 'min', 'max', 'avg', 'sum', 'Min', 'Max', 'Avg', 'Sum']
dimensionsarray of stringsFalse
seriestypestringFalseHow will given series render in Dynatrace UIenum: ['LINE', 'AREA', 'BAR', 'line', 'area', 'bar', 'Line', 'Area', 'Bar']
stackedbooleanFalse
rightaxisbooleanFalse
displaynamestringFalseminLength: 1
unitstringFalseminLength: 1

Metrics

This part of the JSON is an array and defines which metrics are fetched by the extension. Each metric is defined by independently by JSON. There are two types of metrics available: timeseries and statetimeseries

json
[ { "statetimeseries": { "key": "service.state_5", "states": ["DOWNTIME", "MAINTENANCE", "WORKING"], "displayname": "Service State", "source": { "state_entrypoint": "/api/state" } }, "entity": "CUSTOM_DEVICE" }, { "timeseries": { "key": "service.querries_per_second", "unit": "PerSecond", "displayname": "Querries per second", "aggregation": "AVG" }, "entity": "CUSTOM_DEVICE_GROUP", "alert_settings": [ { "alert_id": "custom_connections_alert", "event_type": "AVAILABILITY_EVENT", "event_name": "No connections!", "description": "The {metricname} of {severity} is {alert_condition} the threshold of {threshold}", "threshold": 0.01, "alert_condition": "ABOVE", "samples": 5, "violating_samples": 1, "dealerting_samples": 5 } ] }, { "timeseries": { "key": "databases.table_size", "unit": "MegaByte", "displayname": "Table size", "aggregation": "MAX", "dimensions": ["table_name"] }, "entity": "CUSTOM_DEVICE" }, { "timeseries": { "key": "databases.total_num_entities", "unit": "Count", "displayname": "Total num ", "aggregation": "MAX" }, "entity": "CUSTOM_DEVICE" }, { "timeseries": { "key": "databases.replicated_entries", "unit": "Count", "displayname": "Archived Entries", "aggregation": "SUM" }, "entity": "CUSTOM_DEVICE" } ]

Metrics section

Array item have to match one of:

FieldTypeRequiredDescriptionValidation
timeseriesobjectTrueTimeseries definition
entitystringFalseenum: ['CUSTOM_DEVICE', 'CUSTOM_DEVICE_GROUP']
alert_settingsarray of objectsFalse
sourceobjectFalseCan be used to specify any valid JSON structure, to be processed by the Plugin.
FieldTypeRequiredDescriptionValidation
statetimeseriesobjectTrueStatetimeseries definition
entitystringFalseenum: ['CUSTOM_DEVICE', 'CUSTOM_DEVICE_GROUP']
alert_settingsarray of objectsFalse

Where timeseries and statetimeseries are defined as:

Timeseries

FieldTypeRequiredDescriptionValidation
keystringTrueMetric name specificationminLength: 1, pattern: ^([a-zA-Z][a-zA-Z0-9_-]*)(.[a-zA-Z][a-zA-Z0-9_-]*)*$
unitstringTrueMetric unit. See the link for available units.enum: ['NanoSecond', 'MicroSecond', 'MilliSecond', 'Second', 'Byte', 'KiloByte', 'KibiByte', 'MegaByte', 'MebiByte', 'BytePerSecond', 'BytePerMinute', 'KiloBytePerSecond', 'KiloBytePerMinute', 'KibiBytePerSecond', 'KibiBytePerMinute', 'MegaBytePerSecond', 'MegaBytePerMinute', 'MebiBytePerSecond', 'MebiBytePerMinute', 'Ratio', 'Percent', 'Promille', 'Count', 'PerSecond', 'PerMinute', 'Unspecified', 'NotApplicable']
aggregationstringFalseTime series data point aggregationenum: ['min', 'max', 'avg', 'sum', 'count', 'MIN', 'MAX', 'AVG', 'SUM', 'COUNT', 'Min', 'Max', 'Avg', 'Sum', 'Count']
dimensionsarray of stringsFalseDimensions are used to provide 1 metric per plugin ObjectName key property value. For example, version, service, or database. Dimension "rx_pid" at index 0 means the system process ID (PID).
displaynamestringTrueThe name under which the metric will be displayed.minLength: 1

Statetimeseries

FieldTypeRequiredDescriptionValidation
keystringTrueMetric name specificationminLength: 1, pattern: ^([a-zA-Z][a-zA-Z0-9_-]*)(.[a-zA-Z][a-zA-Z0-9_-]*)*$
dimensionsarray of stringsFalse
statesarray of stringsTrue
displaynamestringTrueminLength: 1
sourceobjectFalseCan be used to specify any valid JSON structure, to be processed by the Plugin.

Alerts

Both timeseries and statetimeseries can define alerts. To do it, use the alert_settings which is an array of objects, where each object looks like:

json
{ "alert_id": "custom_connections_alert", "event_type": "AVAILABILITY_EVENT", "event_name": "No connections!", "description": "The {metricname} of {severity} is {alert_condition} the threshold of {threshold}", "threshold": 0.01, "alert_condition": "ABOVE", "samples": 5, "violating_samples": 1, "dealerting_samples": 5 }

ActiveGate Plugin Alert

Alert

Array item definition:

FieldTypeRequiredDescriptionValidation
alert_idstringTrueMetric name specificationminLength: 1, pattern: ^([a-zA-Z][a-zA-Z0-9_-]*)(.[a-zA-Z][a-zA-Z0-9_-]*)*$
event_typestringTrueEvent typeenum: ['PERFORMANCE_EVENT', 'AVAILABILITY_EVENT', 'ERROR_EVENT']
descriptionstringFalseDescription defines alert message, following code snippets could be used: {threshold} the value of the custom threshold that was violated {severity} the violating value {entityname} the display name of the entity where the metric violated {violating_samples} the number of violating samples that led to that event {dimensions} a string containg the violating dimensions of the metric {alert_condition} a string showing if above or below threshold is alerting
alert_conditionstringTrueAlert conditionenum: ['ABOVE', 'BELOW']
event_namestringTrueEvent name displayed on UI pages.minLength: 1
thresholdnumberTrueThe value of the threshold.
samplesintegerTrueSize of the "window" in which violating_samples are counted.
violating_samplesintegerTrueThe number of violating samples that rise an alert. Must be less that samples.
dealerting_samplesintegerTrueThe number of not violating samples that deactivate and alert. Must be less that samples.

Configuration

The extension configuration section controls the extension data appearance in the web UI at Settings > Monitored technologies and its configuration, for example: user name, password, connection string, etc. The configUI section defines the configuration fields that are displayed in the UI. The properties section defines the configuration properties that are sent to the extension.

ConfigUI

Example ConfigUI section:

json
{ "configUI": { "displayName": "CustomCloudTechnology", "properties": [ { "key": "url", "displayName": "URL", "displayOrder": 3, "displayHint": "http://localhost:9200/" }, { "key": "auth_user", "displayName": "User", "displayOrder": 1, "displayHint": "Leave empty if no authentication is set up" }, { "key": "auth_password", "displayName": "Password", "displayOrder": 2, "displayHint": "Leave empty if no authentication is set up", "defaultValue": "somepassword" }, { "key": "state_interval", "displayName": "State change interval", "displayOrder": 3, "displayHint": "How often state metrics changes", "defaultValue": 60 }, { "key": "alert_interval", "displayName": "Alert interval", "displayOrder": 4, "displayHint": "How often an alert is raised", "defaultValue": 360 }, { "key": "event_interval", "displayName": "Event interval", "displayOrder": 5, "displayHint": "How often an event is raised", "defaultValue": 240 }, { "key": "relative_interval", "displayName": "Relative interval", "displayOrder": 6, "displayHint": "How often relative metric is submitted", "defaultValue": 60 } ] } }

This is how it looks in Monitored Technologies:

ActiveGate Plugin ConfigUI

Note the two additional fields:

  • Endpoint is a CustomDevice name
  • Choose ActiveGate is a dropdown of all available ActiveGate PluginModules. Select the one you want to use to execute the extension.

ConfigUI is an array of objects:

Config UI section

FieldTypeRequiredDescriptionValidation
displayNamestringFalseHuman readable plugin name. This name is displayed in web UI at Settings > Monitored technologies > Custom plugins once the plugin is uploaded.minLength: 1
propertiesarray of objectsFalse

Properties is an array of objects that are used to define fields for extension configuration page:

ConfigUI properties

Array item definition:

FieldTypeRequiredDescriptionValidation
keystringTrueConfig property key, needs to match key from configUI properties sectionminLength: 1
displayNamestringTrueHuman readable property name.minLength: 1
displayOrderintegerFalseDetermines display order on plugin configuration tile.
displayHintstringFalseHint displayed in the tool-tip.

Properties

Example Properties section:

json
{ "properties": [ { "key": "url", "type": "String" }, { "key": "auth_user", "type": "String" }, { "key": "auth_password", "type": "Password" }, { "key": "state_interval", "type": "Integer", "defaultValue": 60 }, { "key": "alert_interval", "type": "Integer", "defaultValue": 360 }, { "key": "event_interval", "type": "Integer", "defaultValue": 240 }, { "key": "relative_interval", "type": "Integer", "defaultValue": 60 } ] }

Properties is an array of objects:

Plugin properties

Array item definition:

FieldTypeRequiredDescriptionValidation
keystringTrueProperty key. Must be unique within this plugin and must match the key from configUI properties.minLength: 1
typestringTrueFor 'PASSWORD' stars will be displayed while typing.enum: ['STRING', 'BOOLEAN', 'INTEGER', 'FLOAT', 'PASSWORD', 'JSON', 'TEXTAREA', 'DROPDOWN', 'string', 'boolean', 'integer', 'float', 'password', 'json', 'textarea', 'dropdown', 'String', 'Boolean', 'Integer', 'Float', 'Password', 'Json', 'Textarea', 'Dropdown']
defaultValuestringFalseDefault value.