AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Class: Aws::CloudWatchLogs::Types::MetricTransformation

Inherits:
Struct
  • Object
show all
Defined in:
gems/aws-sdk-cloudwatchlogs/lib/aws-sdk-cloudwatchlogs/types.rb

Overview

Note:

When making an API call, you may pass MetricTransformation data as a hash:

{
  metric_name: "MetricName", # required
  metric_namespace: "MetricNamespace", # required
  metric_value: "MetricValue", # required
  default_value: 1.0,
  dimensions: {
    "DimensionsKey" => "DimensionsValue",
  },
  unit: "Seconds", # accepts Seconds, Microseconds, Milliseconds, Bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits, Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second, Megabytes/Second, Gigabytes/Second, Terabytes/Second, Bits/Second, Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second, Count/Second, None
}

Indicates how to transform ingested log events to metric data in a CloudWatch metric.

Constant Summary collapse

SENSITIVE =
[]

Instance Attribute Summary collapse

Instance Attribute Details

#default_valueFloat

(Optional) The value to emit when a filter pattern does not match a log event. This value can be null.

Returns:

  • (Float)


1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
# File 'gems/aws-sdk-cloudwatchlogs/lib/aws-sdk-cloudwatchlogs/types.rb', line 1902

class MetricTransformation < Struct.new(
  :metric_name,
  :metric_namespace,
  :metric_value,
  :default_value,
  :dimensions,
  :unit)
  SENSITIVE = []
  include Aws::Structure
end

#dimensionsHash<String,String>

The fields to use as dimensions for the metric. One metric filter can include as many as three dimensions.

Metrics extracted from log events are charged as custom metrics. To prevent unexpected high charges, do not specify high-cardinality fields such as IPAddress or requestID as dimensions. Each different value found for a dimension is treated as a separate metric and accrues charges as a separate custom metric.

To help prevent accidental high charges, Amazon disables a metric filter if it generates 1000 different name/value pairs for the dimensions that you have specified within a certain amount of time.

You can also set up a billing alarm to alert you if your charges are higher than expected. For more information, see Creating a Billing Alarm to Monitor Your Estimated Amazon Web Services Charges.

Returns:

  • (Hash<String,String>)


1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
# File 'gems/aws-sdk-cloudwatchlogs/lib/aws-sdk-cloudwatchlogs/types.rb', line 1902

class MetricTransformation < Struct.new(
  :metric_name,
  :metric_namespace,
  :metric_value,
  :default_value,
  :dimensions,
  :unit)
  SENSITIVE = []
  include Aws::Structure
end

#metric_nameString

The name of the CloudWatch metric.

Returns:

  • (String)


1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
# File 'gems/aws-sdk-cloudwatchlogs/lib/aws-sdk-cloudwatchlogs/types.rb', line 1902

class MetricTransformation < Struct.new(
  :metric_name,
  :metric_namespace,
  :metric_value,
  :default_value,
  :dimensions,
  :unit)
  SENSITIVE = []
  include Aws::Structure
end

#metric_namespaceString

A custom namespace to contain your metric in CloudWatch. Use namespaces to group together metrics that are similar. For more information, see Namespaces.

Returns:

  • (String)


1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
# File 'gems/aws-sdk-cloudwatchlogs/lib/aws-sdk-cloudwatchlogs/types.rb', line 1902

class MetricTransformation < Struct.new(
  :metric_name,
  :metric_namespace,
  :metric_value,
  :default_value,
  :dimensions,
  :unit)
  SENSITIVE = []
  include Aws::Structure
end

#metric_valueString

The value to publish to the CloudWatch metric when a filter pattern matches a log event.

Returns:

  • (String)


1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
# File 'gems/aws-sdk-cloudwatchlogs/lib/aws-sdk-cloudwatchlogs/types.rb', line 1902

class MetricTransformation < Struct.new(
  :metric_name,
  :metric_namespace,
  :metric_value,
  :default_value,
  :dimensions,
  :unit)
  SENSITIVE = []
  include Aws::Structure
end

#unitString

The unit to assign to the metric. If you omit this, the unit is set as None.

Returns:

  • (String)


1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
# File 'gems/aws-sdk-cloudwatchlogs/lib/aws-sdk-cloudwatchlogs/types.rb', line 1902

class MetricTransformation < Struct.new(
  :metric_name,
  :metric_namespace,
  :metric_value,
  :default_value,
  :dimensions,
  :unit)
  SENSITIVE = []
  include Aws::Structure
end