LogMetric class final
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.
- Inheritance
-
- Object
- ProtoMessage
- LogMetric
Constructors
-
LogMetric({required String name, String description = '', required String filter, String bucketName = '', bool disabled = false, MetricDescriptor? metricDescriptor, String valueExtractor = '', Map<
String, String> labelExtractors = const {}, Distribution_BucketOptions? bucketOptions, Timestamp? createTime, Timestamp? updateTime, LogMetric_ApiVersion version = LogMetric_ApiVersion.$default}) - LogMetric.fromJson(Object? j)
-
factory
Properties
- bucketName → String
-
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.
final
- bucketOptions → Distribution_BucketOptions?
-
Optional. The
bucket_optionsare 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.final - createTime → Timestamp?
-
Output only. The creation timestamp of the metric.
final
- description → String
-
Optional. A description of this metric, which is used in documentation.
The maximum length of the description is 8000 characters.
final
- disabled → bool
-
Optional. If set to True, then this metric is disabled and it does not
generate any points.
final
- filter → String
-
Required. An advanced logs
filter which
is used to match log entries. Example:
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
labelExtractors
→ Map<
String, String> -
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_extractorfield.final - metricDescriptor → MetricDescriptor?
-
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
filterexpression.final - name → String
-
Required. The client-assigned metric identifier.
Examples:
"error_count","nginx/requests".final - qualifiedName → String
-
The fully qualified name of this message, i.e.,
google.protobuf.Durationorgoogle.rpc.ErrorInfo.finalinherited - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- updateTime → Timestamp?
-
Output only. The last update timestamp of the metric.
final
- valueExtractor → String
-
Optional. A
value_extractoris 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)orREGEXP_EXTRACT(field, regex). The arguments are:final - version → LogMetric_ApiVersion
-
Deprecated. The API version that created or updated this metric.
The v2 format is used by default and cannot be changed.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Object -
override
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- fullyQualifiedName → const String