Class: Google::Apis::LoggingV2beta1::LogMetric

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
generated/google/apis/logging_v2beta1/classes.rb,
generated/google/apis/logging_v2beta1/representations.rb,
generated/google/apis/logging_v2beta1/representations.rb

Overview

Describes a logs-based metric. The value of the metric is the number of log entries that match a logs filter.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ LogMetric

Returns a new instance of LogMetric.


235
236
237
# File 'generated/google/apis/logging_v2beta1/classes.rb', line 235

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#descriptionString

Optional. A description of this metric, which is used in documentation. Corresponds to the JSON property description

Returns:

  • (String)

208
209
210
# File 'generated/google/apis/logging_v2beta1/classes.rb', line 208

def description
  @description
end

#filterString

Required. An advanced logs filter. Example: "resource.type=gae_app AND severity>=ERROR". Corresponds to the JSON property filter

Returns:

  • (String)

214
215
216
# File 'generated/google/apis/logging_v2beta1/classes.rb', line 214

def filter
  @filter
end

#nameString

Required. The client-assigned metric identifier. Example: "severe_errors". 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. The '%' character is used to URL encode unsafe and reserved characters and must be followed by two hexadecimal digits according to RFC 1738. Corresponds to the JSON property name

Returns:

  • (String)

226
227
228
# File 'generated/google/apis/logging_v2beta1/classes.rb', line 226

def name
  @name
end

#versionString

Output only. The API version that created or updated this metric. The version also dictates the syntax of the filter expression. When a value for this field is missing, the default value of V2 should be assumed. Corresponds to the JSON property version

Returns:

  • (String)

233
234
235
# File 'generated/google/apis/logging_v2beta1/classes.rb', line 233

def version
  @version
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object


240
241
242
243
244
245
# File 'generated/google/apis/logging_v2beta1/classes.rb', line 240

def update!(**args)
  @description = args[:description] if args.key?(:description)
  @filter = args[:filter] if args.key?(:filter)
  @name = args[:name] if args.key?(:name)
  @version = args[:version] if args.key?(:version)
end