Class: Google::Logging::V2::LogMetric

Inherits:
Object
  • Object
show all
Defined in:
lib/google/cloud/logging/v2/doc/google/logging/v2/logging_metrics.rb

Overview

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.

Defined Under Namespace

Modules: ApiVersion

Instance Attribute Summary collapse

Instance Attribute Details

#descriptionString

Returns Optional. A description of this metric, which is used in documentation.

Returns:

  • (String)

    Optional. A description of this metric, which is used in documentation.



54
55
56
57
58
59
60
61
62
63
# File 'lib/google/cloud/logging/v2/doc/google/logging/v2/logging_metrics.rb', line 54

class LogMetric
  # Stackdriver Logging API version.
  module ApiVersion
    # Stackdriver Logging API v2.
    V2 = 0

    # Stackdriver Logging API v1.
    V1 = 1
  end
end

#filterString

Returns Required. An 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.

Returns:



54
55
56
57
58
59
60
61
62
63
# File 'lib/google/cloud/logging/v2/doc/google/logging/v2/logging_metrics.rb', line 54

class LogMetric
  # Stackdriver Logging API version.
  module ApiVersion
    # Stackdriver Logging API v2.
    V2 = 0

    # Stackdriver Logging API v1.
    V1 = 1
  end
end

#nameString

Returns 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.

The metric identifier in this field must not be URL-encoded[https://en.wikipedia.org/wiki/Percent-encoding]. However, when the metric identifier appears as the +[METRIC_ID]+ part of a +metric_name+ API parameter, then the metric identifier must be URL-encoded. Example: +"projects/my-project/metrics/nginx%2Frequests"+.

Returns:

  • (String)

    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.

    The metric identifier in this field must not be URL-encoded[https://en.wikipedia.org/wiki/Percent-encoding]. However, when the metric identifier appears as the +[METRIC_ID]+ part of a +metric_name+ API parameter, then the metric identifier must be URL-encoded. Example: +"projects/my-project/metrics/nginx%2Frequests"+.



54
55
56
57
58
59
60
61
62
63
# File 'lib/google/cloud/logging/v2/doc/google/logging/v2/logging_metrics.rb', line 54

class LogMetric
  # Stackdriver Logging API version.
  module ApiVersion
    # Stackdriver Logging API v2.
    V2 = 0

    # Stackdriver Logging API v1.
    V1 = 1
  end
end

#versionGoogle::Logging::V2::LogMetric::ApiVersion

Returns 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.

Returns:

  • (Google::Logging::V2::LogMetric::ApiVersion)

    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.



54
55
56
57
58
59
60
61
62
63
# File 'lib/google/cloud/logging/v2/doc/google/logging/v2/logging_metrics.rb', line 54

class LogMetric
  # Stackdriver Logging API version.
  module ApiVersion
    # Stackdriver Logging API v2.
    V2 = 0

    # Stackdriver Logging API v1.
    V1 = 1
  end
end