Class: Google::Apis::LoggingV2beta1::LogMetric
- Inherits:
-
Object
- Object
- Google::Apis::LoggingV2beta1::LogMetric
- 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
-
#description ⇒ String
Optional.
-
#filter ⇒ String
Required.
-
#name ⇒ String
Required.
-
#version ⇒ String
Output only.
Instance Method Summary collapse
-
#initialize(**args) ⇒ LogMetric
constructor
A new instance of LogMetric.
-
#update!(**args) ⇒ Object
Update properties of this object.
Methods included from Core::JsonObjectSupport
Methods included from Core::Hashable
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
#description ⇒ String
Optional. A description of this metric, which is used in documentation.
Corresponds to the JSON property description
208 209 210 |
# File 'generated/google/apis/logging_v2beta1/classes.rb', line 208 def description @description end |
#filter ⇒ String
Required. An advanced logs filter.
Example: "resource.type=gae_app AND severity>=ERROR"
.
Corresponds to the JSON property filter
214 215 216 |
# File 'generated/google/apis/logging_v2beta1/classes.rb', line 214 def filter @filter end |
#name ⇒ String
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
226 227 228 |
# File 'generated/google/apis/logging_v2beta1/classes.rb', line 226 def name @name end |
#version ⇒ String
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
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 |