Create Derived Metric

Create Derived Metric

Create a specific derived metric definition

Request
URI
POST
https://{api_host}/api/v2/derivedmetric
COPY
Request Body

Example Body:

{
  "name": "Query Name",
  "query": "aliasMetric(ts(~sample.cpu.loadavg.1m), \"my.new.metric\")",
  "minutes": 5,
  "additionalInformation": "Additional Info",
  "tags": {
    "customerTags": [
      "derivedMetricTag1"
    ]
  }
}
DerivedMetricDefinition of type(s) application/json
Optional
{
    "tagpaths": [
        "string"
    ],
    "minutes": 0,
    "name": "string",
    "id": "string",
    "query": "string",
    "createdEpochMillis": 0,
    "updatedEpochMillis": 0,
    "tags": {
        "customerTags": [
            "string"
        ]
    },
    "status": [
        "string"
    ],
    "deleted": false,
    "created": 0,
    "queryQBEnabled": false,
    "queryQBSerialization": "string",
    "processRateMinutes": 0,
    "createUserId": "string",
    "updated": 0,
    "updateUserId": "string",
    "queryFailing": false,
    "lastFailedTime": 0,
    "lastErrorMessage": "string",
    "additionalInformation": "string",
    "metricsUsed": [
        "string"
    ],
    "hostsUsed": [
        "string"
    ],
    "inTrash": false,
    "lastProcessedMillis": 0,
    "pointsScannedAtLastQuery": 0,
    "includeObsoleteMetrics": false,
    "lastQueryTime": 0,
    "creatorId": "string",
    "updaterId": "string"
}
array of string
tagpaths
Optional

tagpaths

integer As int32 As int32
minutes
Required

Number of minutes to query for the derived metric

string
name
Required

name

string
id
Optional

id

string
query
Required

A Wavefront query that is evaluated at regular intervals (default 1m).

integer As int64 As int64
createdEpochMillis
Optional

createdEpochMillis

integer As int64 As int64
updatedEpochMillis
Optional

updatedEpochMillis

tags
Optional

tags

array of string
status
Optional

Lists the current state of the derived metric. Can be one or more of: INVALID, ACTIVE, TRASH, NO_DATA

boolean
deleted
Optional

deleted

integer As int64 As int64
created
Optional

When this derived metric was created, in epoch millis

boolean
queryQBEnabled
Optional

Whether the query was created using the Query Builder. Default false

string
queryQBSerialization
Optional

The special serialization of the Query Builder that corresponds to the query. Applicable only when queryQBEnabled is true

integer As int32 As int32
processRateMinutes
Optional

The interval between executing the query, in minutes. Defaults to 1 minute

string
createUserId
Optional

createUserId

integer As int64 As int64
updated
Optional

When the derived metric definition was last updated, in epoch millis

string
updateUserId
Optional

The user that last updated this derived metric definition

boolean
queryFailing
Optional

Whether there was an exception when the query last ran

integer As int64 As int64
lastFailedTime
Optional

The time of the last error encountered when running the query, in epoch millis

string
lastErrorMessage
Optional

The last error encountered when running the query

string
additionalInformation
Optional

User-supplied additional explanatory information for the derived metric

array of string
metricsUsed
Optional

Number of metrics checked by the query

array of string
hostsUsed
Optional

Number of hosts checked by the query

boolean
inTrash
Optional

inTrash

integer As int64 As int64
lastProcessedMillis
Optional

The last time when the derived metric query was run, in epoch millis

integer As int64 As int64
pointsScannedAtLastQuery
Optional

A derived field recording the number of data points scanned when the system last computed the query

boolean
includeObsoleteMetrics
Optional

Whether to include obsolete metrics in query

integer As int64 As int64
lastQueryTime
Optional

Time for the query execute, averaged on hourly basis

string
creatorId
Optional

creatorId

string
updaterId
Optional

updaterId

Authentication
This operation uses the following authentication methods.
Responses
200

successful operation

Returns ResponseContainerDerivedMetricDefinition of type(s) application/json
{
    "status": {
        "result": "string",
        "message": "string",
        "code": 0
    },
    "response": {
        "tagpaths": [
            "string"
        ],
        "minutes": 0,
        "name": "string",
        "id": "string",
        "query": "string",
        "createdEpochMillis": 0,
        "updatedEpochMillis": 0,
        "tags": {
            "customerTags": [
                "string"
            ]
        },
        "status": [
            "string"
        ],
        "deleted": false,
        "created": 0,
        "queryQBEnabled": false,
        "queryQBSerialization": "string",
        "processRateMinutes": 0,
        "createUserId": "string",
        "updated": 0,
        "updateUserId": "string",
        "queryFailing": false,
        "lastFailedTime": 0,
        "lastErrorMessage": "string",
        "additionalInformation": "string",
        "metricsUsed": [
            "string"
        ],
        "hostsUsed": [
            "string"
        ],
        "inTrash": false,
        "lastProcessedMillis": 0,
        "pointsScannedAtLastQuery": 0,
        "includeObsoleteMetrics": false,
        "lastQueryTime": 0,
        "creatorId": "string",
        "updaterId": "string"
    }
}
status
Required

status

response
Optional

response