Definitions for @turbot/gcp-logging

BigQueryOptions

{
"description": "Options that change functionality of a sink exporting data to BigQuery.",
"properties": {
"usePartitionedTables": {
"description": "Optional. Whether to use BigQuery's partition tables (https://cloud.google.com/bigquery/docs/partitioned-tables). By default, Cloud Logging creates dated tables based on the log entries' timestamps, e.g. syslog_20170523. With partitioned tables the date suffix is no longer present and special query syntax (https://cloud.google.com/bigquery/docs/querying-partitioned-tables) has to be used instead. In both cases, tables are sharded based on UTC timezone.",
"type": "boolean"
},
"usesTimestampColumnPartitioning": {
"description": "Output only. True if new timestamp column based partitioning is in use, false if legacy ingress-time partitioning is in use.All new sinks will have this field set true and will use timestamp column based partitioning. If use_partitioned_tables is false, this value has no meaning and will be false. Legacy sinks using partitioned tables will have this field set to false.",
"readOnly": true,
"type": "boolean"
}
},
"type": "object",
".turbot": {
"uri": "tmod:@turbot/gcp-logging#/definitions/BigQueryOptions",
"modUri": "tmod:@turbot/gcp-logging"
}
}

BucketOptions

{
"description": "BucketOptions describes the bucket boundaries used to create a histogram for the distribution. The buckets can be in a linear sequence, an exponential sequence, or each bucket can be specified explicitly. BucketOptions does not include the number of values in each bucket.A bucket has an inclusive lower bound and exclusive upper bound for the values that are counted for that bucket. The upper bound of a bucket must be strictly greater than the lower bound. The sequence of N buckets for a distribution consists of an underflow bucket (number 0), zero or more finite buckets (number 1 through N - 2) and an overflow bucket (number N - 1). The buckets are contiguous: the lower bound of bucket i (i > 0) is the same as the upper bound of bucket i - 1. The buckets span the whole range of finite values: lower bound of the underflow bucket is -infinity and the upper bound of the overflow bucket is +infinity. The finite buckets are so-called because both bounds are finite.",
"properties": {
"explicitBuckets": {
"$ref": "#/definitions/Explicit",
"description": "The explicit buckets."
},
"exponentialBuckets": {
"$ref": "#/definitions/Exponential",
"description": "The exponential buckets."
},
"linearBuckets": {
"$ref": "#/definitions/Linear",
"description": "The linear bucket."
}
},
"type": "object",
".turbot": {
"uri": "tmod:@turbot/gcp-logging#/definitions/BucketOptions",
"modUri": "tmod:@turbot/gcp-logging"
}
}

exclusion

{
"type": "object",
"properties": {
"name": {
"$ref": "#/definitions/exclusionId"
},
"turbot": {
"type": "object",
"properties": {
"akas": {
"type": "array",
"items": {
"$ref": "#/definitions/exclusionAka"
}
},
"title": {
"$ref": "#/definitions/exclusionId"
},
"custom": {
"type": "object",
"properties": {
"createTimestamp": {
"$ref": "turbot#/definitions/isoTimestamp"
},
"gcp": {
"$ref": "gcp#/definitions/gcpMetadata"
},
"lastUsedTimestamp": {
"$ref": "turbot#/definitions/isoTimestamp"
}
}
}
}
}
},
"required": [
"name",
"turbot"
],
"additionalProperties": true,
"tests": [
{
"description": "Valid - All properties",
"input": {
"name": "EXCLUSION_ID",
"turbot": {
"title": "snap-test-123",
"custom": {
"gcp": {
"projectId": "foo-bar"
}
}
}
}
},
{
"description": "Invalid - Missing name",
"input": {
"turbot": {
"title": "snap-test-123",
"custom": {
"gcp": {
"projectId": "foo-bar"
}
}
}
},
"expected": false
},
{
"description": "Invalid - Missing Guardrails data",
"input": {
"name": "EXCLUSION_ID"
},
"expected": false
}
],
".turbot": {
"uri": "tmod:@turbot/gcp-logging#/definitions/exclusion",
"modUri": "tmod:@turbot/gcp-logging"
}
}

exclusionAka

{
"type": "string",
"pattern": "^gcp://logging.googleapis.com/projects/[a-z0-9-]{5,29}[a-z0-9]{1}:exclusions/([\\._A-Za-z0-9-]{1,100})$",
"tests": [
{
"descritpion": "base case",
"input": "gcp://logging.googleapis.com/projects/aar-a4b6d489:exclusions/test"
},
{
"description": "Invalid - Malformed resource collection",
"input": "gcp://logging.googleapis.com/projects/aar-a4b6d489:exclusion/test",
"expected": false
}
],
".turbot": {
"uri": "tmod:@turbot/gcp-logging#/definitions/exclusionAka",
"modUri": "tmod:@turbot/gcp-logging"
}
}

exclusionId

{
"type": "string",
"pattern": "^([\\._A-Za-z0-9-]{1,100})$",
"tests": [
{
"input": "test"
},
{
"input": "EXCLUSION_ID"
},
{
"description": "invalid - incorrect type",
"input": [
"ID"
],
"expected": false
},
{
"description": "invalid - too long",
"input": "789a123456789a123456789a123456789a12ba123456789a123456789a123456789a123456789a123456789a123456789a12b",
"expected": false
}
],
".turbot": {
"uri": "tmod:@turbot/gcp-logging#/definitions/exclusionId",
"modUri": "tmod:@turbot/gcp-logging"
}
}

exclusionServiceNow

{
"defaultColumns": {
"create_time": {
"column": "enabled",
"label": "Create Time"
},
"description": {
"column": "enabled",
"label": "Description"
},
"disabled": {
"column": "enabled",
"label": "Disabled",
"type": "boolean"
},
"exclusion_name": {
"column": "enabled",
"label": "Name",
"path": "data.name"
},
"filter": {
"column": "enabled",
"label": "Filter"
},
"project": {
"column": "enabled",
"label": "Project",
"path": "metadata.gcp.projectId"
},
"update_time": {
"column": "enabled",
"label": "Update Time"
}
},
".turbot": {
"uri": "tmod:@turbot/gcp-logging#/definitions/exclusionServiceNow",
"modUri": "tmod:@turbot/gcp-logging"
}
}

Explicit

{
"description": "Specifies a set of buckets with arbitrary widths.There are size(bounds) + 1 (= N) buckets. Bucket i has the following boundaries:Upper bound (0 <= i < N-1): boundsi Lower bound (1 <= i < N); boundsi - 1The bounds field must contain at least one element. If bounds has only one element, then there are no finite buckets, and that single element is the common boundary of the overflow and underflow buckets.",
"properties": {
"bounds": {
"description": "The values must be monotonically increasing.",
"items": {
"type": "number"
},
"type": "array"
}
},
"type": "object",
".turbot": {
"uri": "tmod:@turbot/gcp-logging#/definitions/Explicit",
"modUri": "tmod:@turbot/gcp-logging"
}
}

Exponential

{
"description": "Specifies an exponential sequence of buckets that have a width that is proportional to the value of the lower bound. Each bucket represents a constant relative uncertainty on a specific value in the bucket.There are num_finite_buckets + 2 (= N) buckets. Bucket i has the following boundaries:Upper bound (0 <= i < N-1): scale * (growth_factor ^ i).Lower bound (1 <= i < N): scale * (growth_factor ^ (i - 1)).",
"properties": {
"growthFactor": {
"description": "Must be greater than 1.",
"type": "number"
},
"numFiniteBuckets": {
"description": "Must be greater than 0.",
"type": "integer"
},
"scale": {
"description": "Must be greater than 0.",
"type": "number"
}
},
"type": "object",
".turbot": {
"uri": "tmod:@turbot/gcp-logging#/definitions/Exponential",
"modUri": "tmod:@turbot/gcp-logging"
}
}

filter

{
"type": "string",
"tests": [
{
"input": "resource.type=\\\"audited_resource\\\""
}
],
".turbot": {
"uri": "tmod:@turbot/gcp-logging#/definitions/filter",
"modUri": "tmod:@turbot/gcp-logging"
}
}

LabelDescriptor

{
"description": "A description of a label.",
"properties": {
"description": {
"description": "A human-readable description for the label.",
"type": "string"
},
"key": {
"description": "The label key.",
"type": "string"
},
"valueType": {
"description": "The type of data that can be assigned to the label.",
"enum": [
"STRING",
"BOOL",
"INT64"
],
"type": "string"
}
},
"type": "object",
".turbot": {
"uri": "tmod:@turbot/gcp-logging#/definitions/LabelDescriptor",
"modUri": "tmod:@turbot/gcp-logging"
}
}

Linear

{
"description": "Specifies a linear sequence of buckets that all have the same width (except overflow and underflow). Each bucket represents a constant absolute uncertainty on the specific value in the bucket.There are num_finite_buckets + 2 (= N) buckets. Bucket i has the following boundaries:Upper bound (0 <= i < N-1): offset + (width * i).Lower bound (1 <= i < N): offset + (width * (i - 1)).",
"properties": {
"numFiniteBuckets": {
"description": "Must be greater than 0.",
"type": "integer"
},
"offset": {
"description": "Lower bound of the first bucket.",
"type": "number"
},
"width": {
"description": "Must be greater than 0.",
"type": "number"
}
},
"type": "object",
".turbot": {
"uri": "tmod:@turbot/gcp-logging#/definitions/Linear",
"modUri": "tmod:@turbot/gcp-logging"
}
}

LogExclusion

{
"description": "Specifies a set of log entries that are filtered out by a sink. If your Google Cloud resource receives a large volume of log entries, you can use exclusions to reduce your chargeable logs. Note that exclusions on organization-level and folder-level sinks don't apply to child resources. Note also that you cannot modify the _Required sink or exclude logs from it.",
"properties": {
"createTime": {
"description": "Output only. The creation timestamp of the exclusion.This field may not be present for older exclusions.",
"readOnly": true,
"type": "string"
},
"description": {
"description": "Optional. A description of this exclusion.",
"type": "string"
},
"disabled": {
"description": "Optional. If set to True, then this exclusion is disabled and it does not exclude any log entries. You can update an exclusion to change the value of this field.",
"type": "boolean"
},
"filter": {
"description": "Required. An advanced logs filter (https://cloud.google.com/logging/docs/view/advanced-queries) that matches the log entries to be excluded. By using the sample function (https://cloud.google.com/logging/docs/view/advanced-queries#sample), you can exclude less than 100% of the matching log entries.For example, the following query matches 99% of low-severity log entries from Google Cloud Storage buckets:resource.type=gcs_bucket severity<ERROR sample(insertId, 0.99)",
"type": "string"
},
"name": {
"description": "Output only. A client-assigned identifier, such as \"load-balancer-exclusion\". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods. First character has to be alphanumeric.",
"readOnly": true,
"type": "string"
},
"updateTime": {
"description": "Output only. The last update timestamp of the exclusion.This field may not be present for older exclusions.",
"readOnly": true,
"type": "string"
}
},
"type": "object",
".turbot": {
"uri": "tmod:@turbot/gcp-logging#/definitions/LogExclusion",
"modUri": "tmod:@turbot/gcp-logging"
}
}

logging

{
"type": "object",
"properties": {
"name": {
"$ref": "#/definitions/loggingName"
},
"state": {
"$ref": "gcp#/definitions/state"
},
"config": {
"type": "object"
},
"parent": {
"$ref": "#/definitions/parentName"
},
"turbot": {
"type": "object",
"properties": {
"akas": {
"type": "array",
"items": {
"$ref": "#/definitions/loggingAka"
}
},
"title": {
"type": "string"
},
"custom": {
"type": "object",
"properties": {
"gcp": {
"$ref": "gcp#/definitions/gcpMetadata"
}
}
}
}
}
},
"required": [
"name"
],
"tests": [
{
"description": "All data provided",
"input": {
"name": "projects/932405488407/services/logging.googleapis.com",
"turbot": {
"title": "Stackdriver Logging API",
"custom": {
"projectId": "cse-legolas-2"
}
}
}
},
{
"description": "Invalid - name missing",
"input": {
"turbot": {
"title": "Stackdriver Logging API",
"custom": {
"projectId": "cse-legolas-2"
}
}
},
"expected": false
}
],
".turbot": {
"uri": "tmod:@turbot/gcp-logging#/definitions/logging",
"modUri": "tmod:@turbot/gcp-logging"
}
}

loggingAka

{
"type": "string",
"pattern": "^gcp://serviceusage.googleapis.com/projects/[0-9]{12}/services/logging.googleapis.com$",
"tests": [
{
"descritpion": "base case",
"input": "gcp://serviceusage.googleapis.com/projects/932405488407/services/logging.googleapis.com"
},
{
"description": "invalid - Project number is incorrect",
"input": "gcp://serviceusage.googleapis.com/projects/932405488354407/services/logging.googleapis.com",
"expected": false
}
],
".turbot": {
"uri": "tmod:@turbot/gcp-logging#/definitions/loggingAka",
"modUri": "tmod:@turbot/gcp-logging"
}
}

loggingName

{
"type": "string",
"pattern": "^projects/[0-9]{0,12}/services/logging.googleapis.com$",
"tests": [
{
"descritpion": "base case",
"input": "projects/932405488407/services/logging.googleapis.com"
},
{
"description": "invalid - Project number is incorrect",
"input": "projects/932405488354407/services/logging.googleapis.com",
"expected": false
}
],
".turbot": {
"uri": "tmod:@turbot/gcp-logging#/definitions/loggingName",
"modUri": "tmod:@turbot/gcp-logging"
}
}

LogMetric

{
"description": "Describes a logs-based metric. The value of the metric is the number of log entries that match a logs filter in a given time interval.Logs-based metrics can also be used to extract values from logs and create a distribution of the values. The distribution records the statistics of the extracted values along with an optional histogram of the values as specified by the bucket options.",
"properties": {
"bucketName": {
"description": "Optional. The resource name of the Log Bucket that owns the Log Metric. Only Log Buckets in projects are supported. The bucket has to be in the same project as the metric.For example:projects/my-project/locations/global/buckets/my-bucketIf empty, then the Log Metric is considered a non-Bucket Log Metric.",
"type": "string"
},
"bucketOptions": {
"$ref": "#/definitions/BucketOptions",
"description": "Optional. The bucket_options are required when the logs-based metric is using a DISTRIBUTION value type and it describes the bucket boundaries used to create a histogram of the extracted values."
},
"createTime": {
"description": "Output only. The creation timestamp of the metric.This field may not be present for older metrics.",
"readOnly": true,
"type": "string"
},
"description": {
"description": "Optional. A description of this metric, which is used in documentation. The maximum length of the description is 8000 characters.",
"type": "string"
},
"disabled": {
"description": "Optional. If set to True, then this metric is disabled and it does not generate any points.",
"type": "boolean"
},
"filter": {
"description": "Required. An advanced logs filter (https://cloud.google.com/logging/docs/view/advanced_filters) which is used to match log entries. Example: \"resource.type=gae_app AND severity>=ERROR\" The maximum length of the filter is 20000 characters.",
"type": "string"
},
"labelExtractors": {
"additionalProperties": {
"type": "string"
},
"description": "Optional. A map from a label key string to an extractor expression which is used to extract data from a log entry field and assign as the label value. Each label key specified in the LabelDescriptor must have an associated extractor expression in this map. The syntax of the extractor expression is the same as for the value_extractor field.The extracted value is converted to the type defined in the label descriptor. If either the extraction or the type conversion fails, the label will have a default value. The default value for a string label is an empty string, for an integer label its 0, and for a boolean label its false.Note that there are upper bounds on the maximum number of labels and the number of active time series that are allowed in a project.",
"type": "object"
},
"metricDescriptor": {
"$ref": "#/definitions/MetricDescriptor",
"description": "Optional. The metric descriptor associated with the logs-based metric. If unspecified, it uses a default metric descriptor with a DELTA metric kind, INT64 value type, with no labels and a unit of \"1\". Such a metric counts the number of log entries matching the filter expression.The name, type, and description fields in the metric_descriptor are output only, and is constructed using the name and description field in the LogMetric.To create a logs-based metric that records a distribution of log values, a DELTA metric kind with a DISTRIBUTION value type must be used along with a value_extractor expression in the LogMetric.Each label in the metric descriptor must have a matching label name as the key and an extractor expression as the value in the label_extractors map.The metric_kind and value_type fields in the metric_descriptor cannot be updated once initially configured. New labels can be added in the metric_descriptor, but existing labels cannot be modified except for their description."
},
"name": {
"description": "Required. The client-assigned metric identifier. Examples: \"error_count\", \"nginx/requests\".Metric identifiers are limited to 100 characters and can include only the following characters: A-Z, a-z, 0-9, and the special characters _-.,+!*',()%/. The forward-slash character (/) denotes a hierarchy of name pieces, and it cannot be the first character of the name.This field is the [METRIC_ID] part of a metric resource name in the format \"projects/PROJECT_ID/metrics/METRIC_ID\". Example: If the resource name of a metric is \"projects/my-project/metrics/nginx%2Frequests\", this field's value is \"nginx/requests\".",
"type": "string"
},
"updateTime": {
"description": "Output only. The last update timestamp of the metric.This field may not be present for older metrics.",
"readOnly": true,
"type": "string"
},
"valueExtractor": {
"description": "Optional. A value_extractor is required when using a distribution logs-based metric to extract the values to record from a log entry. Two functions are supported for value extraction: EXTRACT(field) or REGEXP_EXTRACT(field, regex). The arguments are: field: The name of the log entry field from which the value is to be extracted. regex: A regular expression using the Google RE2 syntax (https://github.com/google/re2/wiki/Syntax) with a single capture group to extract data from the specified log entry field. The value of the field is converted to a string before applying the regex. It is an error to specify a regex that does not include exactly one capture group.The result of the extraction must be convertible to a double type, as the distribution always records double values. If either the extraction or the conversion to double fails, then those values are not recorded in the distribution.Example: REGEXP_EXTRACT(jsonPayload.request, \".*quantity=(\\d+).*\")",
"type": "string"
},
"version": {
"deprecated": true,
"description": "Deprecated. The API version that created or updated this metric. The v2 format is used by default and cannot be changed.",
"enum": [
"V2",
"V1"
],
"type": "string"
}
},
"type": "object",
".turbot": {
"uri": "tmod:@turbot/gcp-logging#/definitions/LogMetric",
"modUri": "tmod:@turbot/gcp-logging"
}
}

logName

{
"type": "string",
"pattern": "^[^/]+/[^/]+$",
"tests": [
{
"input": "projects/cse-legolas"
},
{
"description": "invalid - regex pattern doesn't match",
"input": "s",
"expected": false
}
],
".turbot": {
"uri": "tmod:@turbot/gcp-logging#/definitions/logName",
"modUri": "tmod:@turbot/gcp-logging"
}
}

LogSink

{
"description": "Describes a sink used to export log entries to one of the following destinations: a Cloud Logging log bucket, a Cloud Storage bucket, a BigQuery dataset, a Pub/Sub topic, a Cloud project.A logs filter controls which log entries are exported. The sink must be created within a project, organization, billing account, or folder.",
"properties": {
"bigqueryOptions": {
"$ref": "#/definitions/BigQueryOptions",
"description": "Optional. Options that affect sinks exporting data to BigQuery."
},
"createTime": {
"description": "Output only. The creation timestamp of the sink.This field may not be present for older sinks.",
"readOnly": true,
"type": "string"
},
"description": {
"description": "Optional. A description of this sink.The maximum length of the description is 8000 characters.",
"type": "string"
},
"destination": {
"description": "Required. The export destination: \"storage.googleapis.com/[GCS_BUCKET]\" \"bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]\" \"pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]\" \"logging.googleapis.com/projects/[PROJECT_ID]\" \"logging.googleapis.com/projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" The sink's writer_identity, set when the sink is created, must have permission to write to the destination or else the log entries are not exported. For more information, see Exporting Logs with Sinks (https://cloud.google.com/logging/docs/api/tasks/exporting-logs).",
"type": "string"
},
"disabled": {
"description": "Optional. If set to true, then this sink is disabled and it does not export any log entries.",
"type": "boolean"
},
"exclusions": {
"description": "Optional. Log entries that match any of these exclusion filters will not be exported.If a log entry is matched by both filter and one of exclusion_filters it will not be exported.",
"items": {
"$ref": "#/definitions/LogExclusion"
},
"type": "array"
},
"filter": {
"description": "Optional. An advanced logs filter (https://cloud.google.com/logging/docs/view/advanced-queries). The only exported log entries are those that are in the resource owning the sink and that match the filter.For example:logName=\"projects/[PROJECT_ID]/logs/[LOG_ID]\" AND severity>=ERROR",
"type": "string"
},
"includeChildren": {
"description": "Optional. This field applies only to sinks owned by organizations and folders. If the field is false, the default, only the logs owned by the sink's parent resource are available for export. If the field is true, then log entries from all the projects, folders, and billing accounts contained in the sink's parent resource are also available for export. Whether a particular log entry from the children is exported depends on the sink's filter expression.For example, if this field is true, then the filter resource.type=gce_instance would export all Compute Engine VM instance log entries from all projects in the sink's parent.To only export entries from certain child projects, filter on the project part of the log name:logName:(\"projects/test-project1/\" OR \"projects/test-project2/\") AND resource.type=gce_instance",
"type": "boolean"
},
"name": {
"description": "Output only. The client-assigned sink identifier, unique within the project.For example: \"my-syslog-errors-to-pubsub\".Sink identifiers are limited to 100 characters and can include only the following characters: upper and lower-case alphanumeric characters, underscores, hyphens, periods.First character has to be alphanumeric.",
"readOnly": true,
"type": "string"
},
"outputVersionFormat": {
"deprecated": true,
"description": "Deprecated. This field is unused.",
"enum": [
"VERSION_FORMAT_UNSPECIFIED",
"V2",
"V1"
],
"type": "string"
},
"updateTime": {
"description": "Output only. The last update timestamp of the sink.This field may not be present for older sinks.",
"readOnly": true,
"type": "string"
},
"writerIdentity": {
"description": "Output only. An IAM identity—a service account or group—under which Cloud Logging writes the exported log entries to the sink's destination. This field is either set by specifying custom_writer_identity or set automatically by sinks.create and sinks.update based on the value of unique_writer_identity in those methods.Until you grant this identity write-access to the destination, log entry exports from this sink will fail. For more information, see Granting Access for a Resource (https://cloud.google.com/iam/docs/granting-roles-to-service-accounts#granting_access_to_a_service_account_for_a_resource). Consult the destination service's documentation to determine the appropriate IAM roles to assign to the identity.Sinks that have a destination that is a log bucket in the same project as the sink cannot have a writer_identity and no additional permissions are required.",
"readOnly": true,
"type": "string"
}
},
"type": "object",
".turbot": {
"uri": "tmod:@turbot/gcp-logging#/definitions/LogSink",
"modUri": "tmod:@turbot/gcp-logging"
}
}

metric

{
"type": "object",
"properties": {
"name": {
"$ref": "#/definitions/metricName"
},
"turbot": {
"type": "object",
"properties": {
"akas": {
"type": "array",
"items": {
"$ref": "#/definitions/metricAka"
}
},
"title": {
"$ref": "#/definitions/metricName"
},
"custom": {
"type": "object",
"properties": {
"createTimestamp": {
"$ref": "turbot#/definitions/isoTimestamp"
},
"gcp": {
"$ref": "gcp#/definitions/gcpMetadata"
},
"lastUsedTimestamp": {
"$ref": "turbot#/definitions/isoTimestamp"
}
}
}
}
}
},
"required": [
"name",
"turbot"
],
"additionalProperties": true,
"tests": [
{
"description": "Valid - All properties",
"input": {
"name": "ved123",
"turbot": {
"custom": {
"gcp": {
"projectId": "123-456"
},
"createTimestamp": "2019-04-24T10:42:09.008Z"
}
}
}
},
{
"description": "Invalid - Missing name",
"input": {
"turbot": {
"custom": {
"gcp": {
"projectId": "123-456"
},
"createTimestamp": "2019-04-24T10:42:09.008Z"
}
}
},
"expected": false
}
],
".turbot": {
"uri": "tmod:@turbot/gcp-logging#/definitions/metric",
"modUri": "tmod:@turbot/gcp-logging"
}
}

metricAka

{
"type": "string",
"pattern": "^gcp://logging.googleapis.com/projects/[a-z0-9-]{5,29}[a-z0-9]{1}/metrics/[^/]+",
"tests": [
{
"description": "base case",
"input": "gcp://logging.googleapis.com/projects/cse-legolas-2/metrics/ved123"
},
{
"description": "invalid - missing name",
"input": "gcp://cloudresourcemanager.googleapis.com/projects/aar-a4b6d489/metrics/",
"expected": false
}
],
".turbot": {
"uri": "tmod:@turbot/gcp-logging#/definitions/metricAka",
"modUri": "tmod:@turbot/gcp-logging"
}
}

MetricDescriptor

{
"description": "Defines a metric type and its schema. Once a metric descriptor is created, deleting or altering it stops data collection and makes the metric type's existing data unusable.",
"properties": {
"description": {
"description": "A detailed description of the metric, which can be used in documentation.",
"type": "string"
},
"displayName": {
"description": "A concise name for the metric, which can be displayed in user interfaces. Use sentence case without an ending period, for example \"Request count\". This field is optional but it is recommended to be set for any metrics associated with user-visible concepts, such as Quota.",
"type": "string"
},
"labels": {
"description": "The set of labels that can be used to describe a specific instance of this metric type. For example, the appengine.googleapis.com/http/server/response_latencies metric type has a label for the HTTP response code, response_code, so you can look at latencies for successful responses or just for responses that failed.",
"items": {
"$ref": "#/definitions/LabelDescriptor"
},
"type": "array"
},
"launchStage": {
"description": "Optional. The launch stage of the metric definition.",
"enum": [
"LAUNCH_STAGE_UNSPECIFIED",
"UNIMPLEMENTED",
"PRELAUNCH",
"EARLY_ACCESS",
"ALPHA",
"BETA",
"GA",
"DEPRECATED"
],
"type": "string"
},
"metadata": {
"$ref": "#/definitions/MetricDescriptorMetadata",
"description": "Optional. Metadata which can be used to guide usage of the metric."
},
"metricKind": {
"description": "Whether the metric records instantaneous values, changes to a value, etc. Some combinations of metric_kind and value_type might not be supported.",
"enum": [
"METRIC_KIND_UNSPECIFIED",
"GAUGE",
"DELTA",
"CUMULATIVE"
],
"type": "string"
},
"monitoredResourceTypes": {
"description": "Read-only. If present, then a time series, which is identified partially by a metric type and a MonitoredResourceDescriptor, that is associated with this metric type can only be associated with one of the monitored resource types listed here.",
"items": {
"type": "string"
},
"type": "array"
},
"name": {
"description": "The resource name of the metric descriptor.",
"type": "string"
},
"type": {
"description": "The metric type, including its DNS name prefix. The type is not URL-encoded. All user-defined metric types have the DNS name custom.googleapis.com or external.googleapis.com. Metric types should use a natural hierarchical grouping. For example: \"custom.googleapis.com/invoice/paid/amount\" \"external.googleapis.com/prometheus/up\" \"appengine.googleapis.com/http/server/response_latencies\" ",
"type": "string"
},
"unit": {
"description": "The units in which the metric value is reported. It is only applicable if the value_type is INT64, DOUBLE, or DISTRIBUTION. The unit defines the representation of the stored metric values.Different systems might 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 might 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 (https://unitsofmeasure.org/ucum.html) standard:Basic units (UNIT) bit bit By byte s second min minute h hour d day 1 dimensionlessPrefixes (PREFIX) k kilo (10^3) M mega (10^6) G giga (10^9) T tera (10^12) P peta (10^15) E exa (10^18) Z zetta (10^21) Y yotta (10^24) m milli (10^-3) u micro (10^-6) n nano (10^-9) p pico (10^-12) f femto (10^-15) a atto (10^-18) z zepto (10^-21) y yocto (10^-24) Ki kibi (2^10) Mi mebi (2^20) Gi gibi (2^30) Ti tebi (2^40) Pi pebi (2^50)GrammarThe grammar also includes these connectors: / division or ratio (as an infix operator). For examples, kBy/{email} or MiBy/10ms (although you should almost never have /s in a metric unit; rates should always be computed at query time from the underlying cumulative or delta value). . multiplication or composition (as an infix operator). For examples, GBy.d or k{watt}.h.The grammar for a unit is as follows: Expression = Component { \".\" Component } { \"/\" Component } ; Component = ( [ PREFIX ] UNIT | \"%\" ) [ Annotation ] | Annotation | \"1\" ; Annotation = \"{\" NAME \"}\" ; Notes: Annotation is just a comment if it follows a UNIT. If the annotation is used alone, then the unit is equivalent to 1. For examples, {request}/s == 1/s, By{transmitted}/s == By/s. NAME is a sequence of non-blank printable ASCII characters not containing { or }. 1 represents a unitary dimensionless unit (https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, such as in 1/s. It is typically used when none of the basic units are appropriate. For example, \"new users per day\" can be represented as 1/d or {new-users}/d (and a metric value 5 would mean \"5 new users). Alternatively, \"thousands of page views per day\" would be represented as 1000/d or k1/d or k{page_views}/d (and a metric value of 5.3 would mean \"5300 page views per day\"). % represents dimensionless value of 1/100, and annotates values giving a percentage (so the metric values are typically in the range of 0..100, and a metric value 3 means \"3 percent\"). 10^2.% indicates a metric contains a ratio, typically in the range 0..1, that will be multiplied by 100 and displayed as a percentage (so a metric value 0.03 means \"3 percent\").",
"type": "string"
},
"valueType": {
"description": "Whether the measurement is an integer, a floating-point number, etc. Some combinations of metric_kind and value_type might not be supported.",
"enum": [
"VALUE_TYPE_UNSPECIFIED",
"BOOL",
"INT64",
"DOUBLE",
"STRING",
"DISTRIBUTION",
"MONEY"
],
"type": "string"
}
},
"type": "object",
".turbot": {
"uri": "tmod:@turbot/gcp-logging#/definitions/MetricDescriptor",
"modUri": "tmod:@turbot/gcp-logging"
}
}

MetricDescriptorMetadata

{
"description": "Additional annotations that can be used to guide the usage of a metric.",
"properties": {
"ingestDelay": {
"description": "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.",
"type": "string"
},
"launchStage": {
"deprecated": true,
"description": "Deprecated. Must use the MetricDescriptor.launch_stage instead.",
"enum": [
"LAUNCH_STAGE_UNSPECIFIED",
"UNIMPLEMENTED",
"PRELAUNCH",
"EARLY_ACCESS",
"ALPHA",
"BETA",
"GA",
"DEPRECATED"
],
"type": "string"
},
"samplePeriod": {
"description": "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.",
"type": "string"
}
},
"type": "object",
".turbot": {
"uri": "tmod:@turbot/gcp-logging#/definitions/MetricDescriptorMetadata",
"modUri": "tmod:@turbot/gcp-logging"
}
}

metricName

{
"type": "string",
"pattern": "^([\\._A-Za-z0-9-]{1,100})$",
"tests": [
{
"input": "ved123"
},
{
"description": "invalid - contains special characters",
"input": "ved123%adef",
"expected": false
},
{
"description": "invalid - metric_Id begining with a slash",
"input": "/ved123%adef",
"expected": false
}
],
".turbot": {
"uri": "tmod:@turbot/gcp-logging#/definitions/metricName",
"modUri": "tmod:@turbot/gcp-logging"
}
}

metricServiceNow

{
"defaultColumns": {
"bucket_name": {
"column": "enabled",
"label": "Bucket Name",
"path": "data.bucketName"
},
"bucket_options": {
"column": "enabled",
"label": "Bucket Options",
"type": "string",
"size": 1000,
"path": "data.bucketOptions"
},
"create_time": {
"column": "enabled",
"label": "Create Time"
},
"disabled": {
"column": "enabled",
"label": "Disabled",
"type": "boolean"
},
"description": {
"column": "enabled",
"label": "Description"
},
"filter": {
"column": "enabled",
"label": "Filter"
},
"label_extractors": {
"column": "enabled",
"label": "Label Extractors",
"type": "string",
"size": 1000,
"path": "data.labelExtractors"
},
"metric_descriptor": {
"column": "enabled",
"label": "Metric Descriptor",
"type": "string",
"size": 2000,
"path": "data.metricDescriptor"
},
"metric_name": {
"column": "enabled",
"label": "Name",
"path": "data.name"
},
"project": {
"column": "enabled",
"label": "Project",
"path": "metadata.gcp.projectId"
},
"update_time": {
"column": "enabled",
"label": "Update Time"
},
"value_extractor": {
"column": "enabled",
"label": "Value Extractor",
"path": "data.valueExtractor"
},
"version": {
"column": "enabled",
"label": "Version"
}
},
".turbot": {
"uri": "tmod:@turbot/gcp-logging#/definitions/metricServiceNow",
"modUri": "tmod:@turbot/gcp-logging"
}
}

parentName

{
"type": "string",
"patterns": "^projects/[0-9]{0,12}",
"tests": [
{
"description": "base",
"input": "projects/932405488407"
},
{
"description": "invalid - Project number is incorrect",
"input": "projects/932405488354407",
"expected": false
}
],
".turbot": {
"uri": "tmod:@turbot/gcp-logging#/definitions/parentName",
"modUri": "tmod:@turbot/gcp-logging"
}
}

sink

{
"type": "object",
"properties": {
"name": {
"$ref": "#/definitions/sinkName"
},
"filter": {
"$ref": "#/definitions/filter"
},
"turbot": {
"type": "object",
"properties": {
"akas": {
"type": "array",
"items": {
"$ref": "#/definitions/sinkAka"
}
},
"title": {
"$ref": "#/definitions/sinkName"
},
"custom": {
"type": "object",
"properties": {
"sinkId": {
"$ref": "#/definitions/sinkId"
},
"gcp": {
"$ref": "gcp#/definitions/gcpMetadata"
},
"createTimestamp": {
"$ref": "turbot#/definitions/isoTimestamp"
},
"lastUsedTimestamp": {
"$ref": "turbot#/definitions/isoTimestamp"
}
}
}
}
}
},
"required": [
"name",
"turbot"
],
"additionalProperties": true,
"tests": [
{
"description": "Valid - All properties",
"input": {
"name": "snap-test-123",
"turbot": {
"custom": {
"gcp": {
"projectId": "foo-bar"
}
}
}
}
},
{
"description": "Invalid - Missing name",
"input": {
"turbot": {
"custom": {
"gcp": {
"projectId": "foo-bar"
}
}
}
},
"expected": false
},
{
"description": "Invalid - Missing Guardrails data",
"input": {
"name": "snap-test-123"
},
"expected": false
}
],
".turbot": {
"uri": "tmod:@turbot/gcp-logging#/definitions/sink",
"modUri": "tmod:@turbot/gcp-logging"
}
}

sinkAka

{
"type": "string",
"pattern": "^gcp://logging.googleapis.com/projects/[a-z0-9-]{5,29}[a-z0-9]{1}/sink/[\\._A-Za-z0-9-]{1,100}$",
"tests": [
{
"descritpion": "base case",
"input": "gcp://logging.googleapis.com/projects/aar-a4b6d489/sink/test"
},
{
"description": "Invalid - Malformed resource collectio",
"input": "gcp://logging.googleapis.com/projects/aar-a4b6d489/sinks/test",
"expected": false
}
],
".turbot": {
"uri": "tmod:@turbot/gcp-logging#/definitions/sinkAka",
"modUri": "tmod:@turbot/gcp-logging"
}
}

sinkId

{
"type": "string",
"pattern": "^projects/[a-z0-9-]{5,29}[a-z0-9]{1}/sinks/[\\._A-Za-z0-9-]{1,100}$",
"tests": [
{
"input": "projects/cse-legolas-2/sinks/spiderman"
},
{
"description": "invalid - Incorrect sinkId",
"input": "projects/cse-legolas-2/sinks",
"expected": false
},
{
"description": "invalid - wrong sink Name",
"input": "projects/cse-legolas-2/sinks/spiderman/@#$@#$",
"expected": false
}
],
".turbot": {
"uri": "tmod:@turbot/gcp-logging#/definitions/sinkId",
"modUri": "tmod:@turbot/gcp-logging"
}
}

sinkName

{
"type": "string",
"pattern": "^[\\._A-Za-z0-9-]{1,100}$",
"tests": [
{
"input": "s"
},
{
"input": "mySink123"
},
{
"input": "my-syslog_errors.to.bucket"
},
{
"description": "invalid - special chars are not allowed",
"input": "my#sink",
"expected": false
},
{
"description": "invalid - too long",
"input": "789a123456789a123456789a123456789a12ba123456789a123456789a123456789a123456789a123456789a123456789a12b",
"expected": false
}
],
".turbot": {
"uri": "tmod:@turbot/gcp-logging#/definitions/sinkName",
"modUri": "tmod:@turbot/gcp-logging"
}
}

sinkServiceNow

{
"defaultColumns": {
"create_time": {
"column": "enabled",
"label": "Create Time"
},
"description": {
"column": "enabled",
"label": "Description"
},
"destination": {
"column": "enabled",
"label": "Destination"
},
"disabled": {
"column": "enabled",
"label": "Disabled",
"type": "boolean"
},
"exclusions": {
"column": "enabled",
"label": "Exclusions",
"type": "string",
"size": 1000
},
"filter": {
"column": "enabled",
"label": "Filter"
},
"include_children": {
"column": "enabled",
"label": "Include Children",
"type": "boolean"
},
"output_version_format": {
"column": "enabled",
"label": "Output Version Format",
"type": "string",
"size": 1000,
"path": "data.outputVersionFormat"
},
"project": {
"column": "enabled",
"label": "Project",
"path": "metadata.gcp.projectId"
},
"sink_name": {
"column": "enabled",
"label": "Name",
"path": "data.name"
},
"update_time": {
"column": "enabled",
"label": "Update Time"
},
"writer_identity": {
"column": "enabled",
"label": "Writer Identity",
"path": "data.writerIdentity"
}
},
".turbot": {
"uri": "tmod:@turbot/gcp-logging#/definitions/sinkServiceNow",
"modUri": "tmod:@turbot/gcp-logging"
}
}