LogMetric class

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.

Available extensions

Constructors

LogMetric({String? name, String? description, String? filter, @Deprecated('This field is deprecated.') LogMetric_ApiVersion? version, MetricDescriptor? metricDescriptor, String? valueExtractor, Iterable<MapEntry<String, String>>? labelExtractors, Distribution_BucketOptions? bucketOptions, Timestamp? createTime, Timestamp? updateTime, bool? disabled})
factory
LogMetric.fromBuffer(List<int> data, [ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY])
factory
LogMetric.fromJson(String json, [ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY])
factory

Properties

bucketOptions Distribution_BucketOptions
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.
getter/setter pair
createTime Timestamp
Output only. The creation timestamp of the metric.
getter/setter pair
description String
Optional. A description of this metric, which is used in documentation. The maximum length of the description is 8000 characters.
getter/setter pair
disabled bool
Optional. If set to True, then this metric is disabled and it does not generate any points.
getter/setter pair
filter String
Required. An advanced logs filter which is used to match log entries. Example:
getter/setter pair
hashCode int
Calculates a hash code based on the contents of the protobuf.
no setterinherited
info_ → BuilderInfo
no setter
isFrozen bool
Returns true if this message is marked read-only. Otherwise false.
no setterinherited
labelExtractors → PbMap<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_extractor field.
no setter
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 filter expression.
getter/setter pair
name String
Required. The client-assigned metric identifier. Examples: "error_count", "nginx/requests".
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
unknownFields → UnknownFieldSet
no setterinherited
updateTime Timestamp
Output only. The last update timestamp of the metric.
getter/setter pair
valueExtractor String
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 argument are:
getter/setter pair
version LogMetric_ApiVersion
Deprecated. The API version that created or updated this metric. The v2 format is used by default and cannot be changed.
getter/setter pair

Methods

addExtension(Extension extension, Object? value) → void
Adds an extension field value to a repeated field.
inherited
check() → void
Throws a StateError if the message has required fields without a value.
inherited
clear() → void
Clears all data that was set in this message.
inherited
clearBucketOptions() → void
clearCreateTime() → void
clearDescription() → void
clearDisabled() → void
clearExtension(Extension extension) → void
Clears an extension field and also removes the extension.
inherited
clearField(int tagNumber) → void
Clears the contents of a given field.
inherited
clearFilter() → void
clearMetricDescriptor() → void
clearName() → void
clearUpdateTime() → void
clearValueExtractor() → void
clearVersion() → void
clone() LogMetric
Creates a deep copy of the fields in this message. (The generated code uses mergeFromMessage.)
copyWith(void updates(LogMetric)) LogMetric
Apply updates to a copy of this message.
createEmptyInstance() LogMetric
Creates an empty instance of the same message type as this.
deepCopy() → T

Available on T, provided by the GeneratedMessageGenericExtensions extension

Returns a writable deep copy of this message.
ensureBucketOptions() Distribution_BucketOptions
ensureCreateTime() Timestamp
ensureMetricDescriptor() MetricDescriptor
ensureUpdateTime() Timestamp
extensionsAreInitialized() bool
inherited
freeze() → GeneratedMessage
Make this message read-only.
inherited
getDefaultForField(int tagNumber) → dynamic
Returns the default value for the given field.
inherited
getExtension(Extension extension) → dynamic
Returns the value of extension.
inherited
getField(int tagNumber) → dynamic
Returns the value of the field associated with tagNumber, or the default value if it is not set.
inherited
getFieldOrNull(int tagNumber) → dynamic
Returns the value of a field, ignoring any defaults.
inherited
getTagNumber(String fieldName) int?
inherited
hasBucketOptions() bool
hasCreateTime() bool
hasDescription() bool
hasDisabled() bool
hasExtension(Extension extension) bool
Returns true if a value of extension is present.
inherited
hasField(int tagNumber) bool
Whether this message has a field associated with tagNumber.
inherited
hasFilter() bool
hasMetricDescriptor() bool
hasName() bool
hasRequiredFields() bool
Whether the message has required fields.
inherited
hasUpdateTime() bool
hasValueExtractor() bool
hasVersion() bool
isInitialized() bool
Whether all required fields in the message and embedded messages are set.
inherited
mergeFromBuffer(List<int> input, [ExtensionRegistry extensionRegistry = ExtensionRegistry.EMPTY]) → void
Merges serialized protocol buffer data into this message.
inherited
mergeFromCodedBufferReader(CodedBufferReader input, [ExtensionRegistry extensionRegistry = ExtensionRegistry.EMPTY]) → void
Same as mergeFromBuffer, but takes a CodedBufferReader input.
inherited
mergeFromJson(String data, [ExtensionRegistry extensionRegistry = ExtensionRegistry.EMPTY]) → void
Merges field values from data, a JSON object, encoded as described by GeneratedMessage.writeToJson.
inherited
mergeFromJsonMap(Map<String, dynamic> json, [ExtensionRegistry extensionRegistry = ExtensionRegistry.EMPTY]) → void
Merges field values from a JSON object represented as a Dart map.
inherited
mergeFromMessage(GeneratedMessage other) → void
Merges the contents of the other into this message.
inherited
mergeFromProto3Json(Object? json, {TypeRegistry typeRegistry = const TypeRegistry.empty(), bool ignoreUnknownFields = false, bool supportNamesWithUnderscores = true, bool permissiveEnums = false}) → void
Merges field values from json, a JSON object using proto3 encoding.
inherited
mergeUnknownFields(UnknownFieldSet unknownFieldSet) → void
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
rebuild(void updates(T)) → T

Available on T, provided by the GeneratedMessageGenericExtensions extension

Apply updates to a copy of this message.
setExtension(Extension extension, Object value) → void
Sets the value of a non-repeated extension field to value.
inherited
setField(int tagNumber, Object value) → void
Sets the value of a field by its tagNumber.
inherited
toBuilder() → GeneratedMessage
Creates a writable, shallow copy of this message.
inherited
toDebugString() String
Returns a String representation of this message.
inherited
toProto3Json({TypeRegistry typeRegistry = const TypeRegistry.empty()}) Object?
Returns an Object representing Proto3 JSON serialization of this.
inherited
toString() String
Returns a String representation of this message.
inherited
writeToBuffer() Uint8List
Serialize the message as the protobuf binary format.
inherited
writeToCodedBufferWriter(CodedBufferWriter output) → void
Same as writeToBuffer, but serializes to the given CodedBufferWriter.
inherited
writeToJson() String
Returns a JSON string that encodes this message.
inherited
writeToJsonMap() Map<String, dynamic>
Returns the JSON encoding of this message as a Dart Map.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

create() LogMetric
createRepeated() → PbList<LogMetric>
getDefault() LogMetric