permalink |
---|
/monitoring_metric_descriptor/ |
monitoring_metric_descriptor
represents the google_monitoring_metric_descriptor
Terraform resource.
This package contains functions and utilities for setting up the resource using Jsonnet code.
fn new()
fn newAttrs()
fn withDescription()
fn withDisplayName()
fn withLabels()
fn withLabelsMixin()
fn withLaunchStage()
fn withMetadata()
fn withMetadataMixin()
fn withMetricKind()
fn withProject()
fn withTimeouts()
fn withTimeoutsMixin()
fn withType()
fn withUnit()
fn withValueType()
obj labels
obj metadata
obj timeouts
new()
google.monitoring_metric_descriptor.new
injects a new google_monitoring_metric_descriptor
Terraform resource
block into the root module document.
Additionally, this inserts a private function into the _ref
attribute that generates references to attributes of the
resource. For example, if you added a new instance to the root using:
# arguments omitted for brevity
google.monitoring_metric_descriptor.new('some_id')
You can get the reference to the id
field of the created google.monitoring_metric_descriptor
using the reference:
$._ref.google_monitoring_metric_descriptor.some_id.get('id')
This is the same as directly entering "${ google_monitoring_metric_descriptor.some_id.id }"
as the value.
NOTE: if you are chaining multiple resources together in a merge operation, you may not be able to use super
, self
,
or $
to refer to the root object. Instead, make an explicit outer object using local
.
Args:
resourceLabel
(string
): The name label of the block.description
(string
): A detailed description of the metric, which can be used in documentation.display_name
(string
): A concise name for the metric, which can be displayed in user interfaces. Use sentence case without an ending period, for example "Request count".launch_stage
(string
): The launch stage of the metric definition. Possible values: ["LAUNCH_STAGE_UNSPECIFIED", "UNIMPLEMENTED", "PRELAUNCH", "EARLY_ACCESS", "ALPHA", "BETA", "GA", "DEPRECATED"] Whennull
, thelaunch_stage
field will be omitted from the resulting object.metric_kind
(string
): Whether the metric records instantaneous values, changes to a value, etc. Some combinations of metricKind and valueType might not be supported. Possible values: ["METRIC_KIND_UNSPECIFIED", "GAUGE", "DELTA", "CUMULATIVE"]project
(string
): Set theproject
field on the resulting resource block. Whennull
, theproject
field will be omitted from the resulting object.type
(string
): The metric type, including its DNS name prefix. The type is not URL-encoded. All service defined metrics must be prefixed with the service name, in the format of {service name}/{relative metric name}, such as cloudsql.googleapis.com/database/cpu/utilization. The relative metric name must have only upper and lower-case letters, digits, '/' and underscores '_' are allowed. Additionally, the maximum number of characters allowed for the relative_metric_name is 100. All user-defined metric types have the DNS name custom.googleapis.com, external.googleapis.com, or logging.googleapis.com/user/.unit
(string
): The units in which the metric value is reported. It is only applicable if the valueType is INT64, DOUBLE, or DISTRIBUTION. The unit defines the representation of the stored metric values.
Different systems may scale the values to be more easily displayed (so a value of 0.02KBy might be displayed as 20By, and a value of 3523KBy might be displayed as 3.5MBy). However, if the unit is KBy, then the value of the metric is always in thousands of bytes, no matter how it may be displayed.
If you want a custom metric to record the exact number of CPU-seconds used by a job, you can create an INT64 CUMULATIVE metric whose unit is s{CPU} (or equivalently 1s{CPU} or just s). If the job uses 12,005 CPU-seconds, then the value is written as 12005.
Alternatively, if you want a custom metric to record data in a more granular way, you
can create a DOUBLE CUMULATIVE metric whose unit is ks{CPU}, and then write the value
12.005 (which is 12005/1000), or use Kis{CPU} and write 11.723 (which is 12005/1024).
The supported units are a subset of The Unified Code for Units of Measure standard.
More info can be found in the API documentation
(https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.metricDescriptors). When null
, the unit
field will be omitted from the resulting object.
value_type
(string
): Whether the measurement is an integer, a floating-point number, etc. Some combinations of metricKind and valueType might not be supported. Possible values: ["BOOL", "INT64", "DOUBLE", "STRING", "DISTRIBUTION"]labels
(list[obj]
): The set of labels that can be used to describe a specific instance of this metric type. In order to delete a label, the entire resource must be deleted, then created with the desired labels. Whennull
, thelabels
sub block will be omitted from the resulting object. When setting the sub block, it is recommended to construct the object using the google.monitoring_metric_descriptor.labels.new constructor.metadata
(list[obj]
): Metadata which can be used to guide usage of the metric. Whennull
, themetadata
sub block will be omitted from the resulting object. When setting the sub block, it is recommended to construct the object using the google.monitoring_metric_descriptor.metadata.new constructor.timeouts
(obj
): Set thetimeouts
field on the resulting resource block. Whennull
, thetimeouts
sub block will be omitted from the resulting object. When setting the sub block, it is recommended to construct the object using the google.monitoring_metric_descriptor.timeouts.new constructor.
Returns:
- A mixin object that injects the new resource into the root Terraform configuration.
newAttrs()
google.monitoring_metric_descriptor.newAttrs
constructs a new object with attributes and blocks configured for the monitoring_metric_descriptor
Terraform resource.
Unlike google.monitoring_metric_descriptor.new, this function will not inject the resource
block into the root Terraform document. Instead, this must be passed in as the attrs
argument for the
tf.withResource function to build a complete block.
This is most useful when you need to preprocess the attributes with functions, conditional, or looping logic prior to injecting into a complete block.
Args:
description
(string
): A detailed description of the metric, which can be used in documentation.display_name
(string
): A concise name for the metric, which can be displayed in user interfaces. Use sentence case without an ending period, for example "Request count".launch_stage
(string
): The launch stage of the metric definition. Possible values: ["LAUNCH_STAGE_UNSPECIFIED", "UNIMPLEMENTED", "PRELAUNCH", "EARLY_ACCESS", "ALPHA", "BETA", "GA", "DEPRECATED"] Whennull
, thelaunch_stage
field will be omitted from the resulting object.metric_kind
(string
): Whether the metric records instantaneous values, changes to a value, etc. Some combinations of metricKind and valueType might not be supported. Possible values: ["METRIC_KIND_UNSPECIFIED", "GAUGE", "DELTA", "CUMULATIVE"]project
(string
): Set theproject
field on the resulting object. Whennull
, theproject
field will be omitted from the resulting object.type
(string
): The metric type, including its DNS name prefix. The type is not URL-encoded. All service defined metrics must be prefixed with the service name, in the format of {service name}/{relative metric name}, such as cloudsql.googleapis.com/database/cpu/utilization. The relative metric name must have only upper and lower-case letters, digits, '/' and underscores '_' are allowed. Additionally, the maximum number of characters allowed for the relative_metric_name is 100. All user-defined metric types have the DNS name custom.googleapis.com, external.googleapis.com, or logging.googleapis.com/user/.unit
(string
): The units in which the metric value is reported. It is only applicable if the valueType is INT64, DOUBLE, or DISTRIBUTION. The unit defines the representation of the stored metric values.
Different systems may scale the values to be more easily displayed (so a value of 0.02KBy might be displayed as 20By, and a value of 3523KBy might be displayed as 3.5MBy). However, if the unit is KBy, then the value of the metric is always in thousands of bytes, no matter how it may be displayed.
If you want a custom metric to record the exact number of CPU-seconds used by a job, you can create an INT64 CUMULATIVE metric whose unit is s{CPU} (or equivalently 1s{CPU} or just s). If the job uses 12,005 CPU-seconds, then the value is written as 12005.
Alternatively, if you want a custom metric to record data in a more granular way, you
can create a DOUBLE CUMULATIVE metric whose unit is ks{CPU}, and then write the value
12.005 (which is 12005/1000), or use Kis{CPU} and write 11.723 (which is 12005/1024).
The supported units are a subset of The Unified Code for Units of Measure standard.
More info can be found in the API documentation
(https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.metricDescriptors). When null
, the unit
field will be omitted from the resulting object.
value_type
(string
): Whether the measurement is an integer, a floating-point number, etc. Some combinations of metricKind and valueType might not be supported. Possible values: ["BOOL", "INT64", "DOUBLE", "STRING", "DISTRIBUTION"]labels
(list[obj]
): The set of labels that can be used to describe a specific instance of this metric type. In order to delete a label, the entire resource must be deleted, then created with the desired labels. Whennull
, thelabels
sub block will be omitted from the resulting object. When setting the sub block, it is recommended to construct the object using the google.monitoring_metric_descriptor.labels.new constructor.metadata
(list[obj]
): Metadata which can be used to guide usage of the metric. Whennull
, themetadata
sub block will be omitted from the resulting object. When setting the sub block, it is recommended to construct the object using the google.monitoring_metric_descriptor.metadata.new constructor.timeouts
(obj
): Set thetimeouts
field on the resulting object. Whennull
, thetimeouts
sub block will be omitted from the resulting object. When setting the sub block, it is recommended to construct the object using the google.monitoring_metric_descriptor.timeouts.new constructor.
Returns:
- An attribute object that can be used with tf.withResource to construct a new
monitoring_metric_descriptor
resource into the root Terraform configuration.
withDescription()
google.string.withDescription
constructs a mixin object that can be merged into the string
Terraform resource block to set or update the description field.
Args:
resourceLabel
(string
): The name label of the block to update.value
(string
): The value to set for thedescription
field.
withDisplayName()
google.string.withDisplayName
constructs a mixin object that can be merged into the string
Terraform resource block to set or update the display_name field.
Args:
resourceLabel
(string
): The name label of the block to update.value
(string
): The value to set for thedisplay_name
field.
withLabels()
google.list[obj].withLabels
constructs a mixin object that can be merged into the list[obj]
Terraform resource block to set or update the labels field.
This function will replace the array with the passed in value
. If you wish to instead append the
passed in value to the existing array, use the google.list[obj].withLabelsMixin function.
Args:
resourceLabel
(string
): The name label of the block to update.value
(list[obj]
): The value to set for thelabels
field.
withLabelsMixin()
google.list[obj].withLabelsMixin
constructs a mixin object that can be merged into the list[obj]
Terraform resource block to set or update the labels field.
This function will append the passed in array or object to the existing array. If you wish
to instead replace the array with the passed in value
, use the google.list[obj].withLabels
function.
Args:
resourceLabel
(string
): The name label of the block to update.value
(list[obj]
): The value to set for thelabels
field.
withLaunchStage()
google.string.withLaunchStage
constructs a mixin object that can be merged into the string
Terraform resource block to set or update the launch_stage field.
Args:
resourceLabel
(string
): The name label of the block to update.value
(string
): The value to set for thelaunch_stage
field.
withMetadata()
google.list[obj].withMetadata
constructs a mixin object that can be merged into the list[obj]
Terraform resource block to set or update the metadata field.
This function will replace the array with the passed in value
. If you wish to instead append the
passed in value to the existing array, use the google.list[obj].withMetadataMixin function.
Args:
resourceLabel
(string
): The name label of the block to update.value
(list[obj]
): The value to set for themetadata
field.
withMetadataMixin()
google.list[obj].withMetadataMixin
constructs a mixin object that can be merged into the list[obj]
Terraform resource block to set or update the metadata field.
This function will append the passed in array or object to the existing array. If you wish
to instead replace the array with the passed in value
, use the google.list[obj].withMetadata
function.
Args:
resourceLabel
(string
): The name label of the block to update.value
(list[obj]
): The value to set for themetadata
field.
withMetricKind()
google.string.withMetricKind
constructs a mixin object that can be merged into the string
Terraform resource block to set or update the metric_kind field.
Args:
resourceLabel
(string
): The name label of the block to update.value
(string
): The value to set for themetric_kind
field.
withProject()
google.string.withProject
constructs a mixin object that can be merged into the string
Terraform resource block to set or update the project field.
Args:
resourceLabel
(string
): The name label of the block to update.value
(string
): The value to set for theproject
field.
withTimeouts()
google.obj.withTimeouts
constructs a mixin object that can be merged into the obj
Terraform resource block to set or update the timeouts field.
This function will replace the map with the passed in value
. If you wish to instead merge the
passed in value to the existing map, use the google.obj.withTimeoutsMixin function.
Args:
resourceLabel
(string
): The name label of the block to update.value
(obj
): The value to set for thetimeouts
field.
withTimeoutsMixin()
google.obj.withTimeoutsMixin
constructs a mixin object that can be merged into the obj
Terraform resource block to set or update the timeouts field.
This function will merge the passed in value to the existing map. If you wish
to instead replace the entire map with the passed in value
, use the google.obj.withTimeouts
function.
Args:
resourceLabel
(string
): The name label of the block to update.value
(obj
): The value to set for thetimeouts
field.
withType()
google.string.withType
constructs a mixin object that can be merged into the string
Terraform resource block to set or update the type field.
Args:
resourceLabel
(string
): The name label of the block to update.value
(string
): The value to set for thetype
field.
withUnit()
google.string.withUnit
constructs a mixin object that can be merged into the string
Terraform resource block to set or update the unit field.
Args:
resourceLabel
(string
): The name label of the block to update.value
(string
): The value to set for theunit
field.
withValueType()
google.string.withValueType
constructs a mixin object that can be merged into the string
Terraform resource block to set or update the value_type field.
Args:
resourceLabel
(string
): The name label of the block to update.value
(string
): The value to set for thevalue_type
field.
new()
google.monitoring_metric_descriptor.labels.new
constructs a new object with attributes and blocks configured for the labels
Terraform sub block.
Args:
description
(string
): A human-readable description for the label. Whennull
, thedescription
field will be omitted from the resulting object.key
(string
): The key for this label. The key must not exceed 100 characters. The first character of the key must be an upper- or lower-case letter, the remaining characters must be letters, digits or underscores, and the key must match the regular expression [a-zA-Z][a-zA-Z0-9_]*value_type
(string
): The type of data that can be assigned to the label. Default value: "STRING" Possible values: ["STRING", "BOOL", "INT64"] Whennull
, thevalue_type
field will be omitted from the resulting object.
Returns:
- An attribute object that represents the
labels
sub block.
new()
google.monitoring_metric_descriptor.metadata.new
constructs a new object with attributes and blocks configured for the metadata
Terraform sub block.
Args:
ingest_delay
(string
): The delay of data points caused by ingestion. Data points older than this age are guaranteed to be ingested and available to be read, excluding data loss due to errors. In 'duration format'. Whennull
, theingest_delay
field will be omitted from the resulting object.sample_period
(string
): The sampling period of metric data points. For metrics which are written periodically, consecutive data points are stored at this time interval, excluding data loss due to errors. Metrics with a higher granularity have a smaller sampling period. In 'duration format'. Whennull
, thesample_period
field will be omitted from the resulting object.
Returns:
- An attribute object that represents the
metadata
sub block.
new()
google.monitoring_metric_descriptor.timeouts.new
constructs a new object with attributes and blocks configured for the timeouts
Terraform sub block.
Args:
create
(string
): Set thecreate
field on the resulting object. Whennull
, thecreate
field will be omitted from the resulting object.delete
(string
): Set thedelete
field on the resulting object. Whennull
, thedelete
field will be omitted from the resulting object.update
(string
): Set theupdate
field on the resulting object. Whennull
, theupdate
field will be omitted from the resulting object.
Returns:
- An attribute object that represents the
timeouts
sub block.