metrics
Creates, updates, deletes, gets or lists a metrics resource.
Overview
| Name | metrics |
| Type | Resource |
| Id | linode.monitor.metrics |
Fields
The following fields are returned by SELECT queries:
- list
Returns a paginated list of metric information.
| Name | Datatype | Description |
|---|---|---|
available_aggregate_functions | array | Available aggregate functions for the metric. (example: increase) |
dimensions | array | Dimensions for the metric. |
is_alertable | boolean | Whether the metric is alertable. |
label | string | The name of the metric. This is used for display purposes in Akamai Cloud Manager. (example: CPU Usage) |
metric | string | The identifier for the metric. This is how the metric is called out in other Monitor operations in the API. (example: cpu_usage) |
metric_type | string | The type of metric. A value of counter represents variable values and a set target for the count. A histogram represents the frequency distribution of data points across a continuous range of numerical values. A gauge represents the performance against a target goal, and summary presents and summarizes data from multiple sources. (counter, histogram, gauge, summary) (example: histogram) |
scrape_interval | string | How frequently a metric is scraped to gather data, using s for seconds, m for minutes, or h for hours. Set to 60s, the metric would be scraped every 60 seconds. Set to 2m, the scrape occurs every two minutes. (example: 60s) |
unit | string | The unit of measurement for the metric. (%, Bytes, sec, bps, msec, Bps, KB, MB, GB, rate, percentile, ratio, OPS, IOPS) (example: Bps) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | serviceType | X-Filter | Beta Returns metrics for a specific service type. > 📘 > > - This operation is beta. Call it using the v4beta path in its URL.> > - For more details on the metrics available for each service, see the Metrics reference. Learn more... Learn more... |
read | exec | serviceType, relative_time_duration, metrics, entity_ids, absolute_time_duration | Beta Returns metrics information for the individual entities within a specific service type. Thi operation also requires an authorization: Bearer token you've created for this serviceType.> 📘 > > - This operation uses a different URL and version from standard Linode API operations. Verify you're using the URL with the monitor-api.linode.com hostname and include v2beta as the version in the URL.> > - For more details on the metrics available for each service, see the Metrics reference. | |
create_token | exec | serviceType, entity_ids | Beta Returns a token that authenticates requests for the entities within a specific service type. The token has a lifetime of six hours after you create it. For an example of the token generation process, see Authenticate Monitor API operations. > 📘 > > - This operation is beta. Call it using the v4beta path in its URL.> > - To see your currently supported services, run the List supported service types operation. > > - You also need read_only access to the scope for the specified serviceType.Learn more... Learn more... |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
serviceType | string | The Akamai Cloud Computing service being monitored. To see your currently supported services, run the List supported service types operation and store the appropriate service_type. |
X-Filter | object | Specifies a JSON object to filter down the results. See Filtering and sorting for details. (example: {{X-Filter}}) |
SELECT examples
- list
Beta Returns metrics for a specific service type.
> 📘
>
> - This operation is beta. Call it using the v4beta path in its URL.
>
> - For more details on the metrics available for each service, see the Metrics reference.
Learn more...
Learn more...
SELECT
available_aggregate_functions,
dimensions,
is_alertable,
label,
metric,
metric_type,
scrape_interval,
unit
FROM linode.monitor.metrics
WHERE serviceType = '{{ serviceType }}' -- required
AND X-Filter = '{{ X-Filter }}'
;
Lifecycle Methods
- read
- create_token
Beta Returns metrics information for the individual entities within a specific service type. Thi operation also requires an authorization: Bearer token you've created for this serviceType.
> 📘
>
> - This operation uses a different URL and version from standard Linode API operations. Verify you're using the URL with the monitor-api.linode.com hostname and include v2beta as the version in the URL.
>
> - For more details on the metrics available for each service, see the Metrics reference.
EXEC linode.monitor.metrics.read
@serviceType='{{ serviceType }}' --required
@@json=
'{
"entity_ids": "{{ entity_ids }}",
"filters": "{{ filters }}",
"group_by": "{{ group_by }}",
"metrics": "{{ metrics }}",
"time_granularity": "{{ time_granularity }}",
"relative_time_duration": "{{ relative_time_duration }}",
"absolute_time_duration": "{{ absolute_time_duration }}"
}'
;
Beta Returns a token that authenticates requests for the entities within a specific service type. The token has a lifetime of six hours after you create it. For an example of the token generation process, see Authenticate Monitor API operations.
> 📘
>
> - This operation is beta. Call it using the v4beta path in its URL.
>
> - To see your currently supported services, run the List supported service types operation.
>
> - You also need read_only access to the scope for the specified serviceType.
Learn more...
Learn more...
EXEC linode.monitor.metrics.create_token
@serviceType='{{ serviceType }}' --required
@@json=
'{
"entity_ids": "{{ entity_ids }}"
}'
;