Class MetricFilterProps
Properties for a MetricFilter.
Inheritance
Namespace: Amazon.CDK.AWS.Logs
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class MetricFilterProps : Object, IMetricFilterProps, IMetricFilterOptions
Syntax (vb)
Public Class MetricFilterProps
Inherits Object
Implements IMetricFilterProps, IMetricFilterOptions
Remarks
ExampleMetadata: lit=aws-logs/test/integ.metricfilter.lit.ts infused
Examples
new MetricFilter(this, "MetricFilter", new MetricFilterProps {
LogGroup = logGroup,
MetricNamespace = "MyApp",
MetricName = "Latency",
FilterPattern = FilterPattern.Exists("$.latency"),
MetricValue = "$.latency"
});
Synopsis
Constructors
MetricFilterProps() |
Properties
DefaultValue | The value to emit if the pattern does not match a particular event. |
Dimensions | The fields to use as dimensions for the metric. |
FilterName | The name of the metric filter. |
FilterPattern | Pattern to search for log events. |
LogGroup | The log group to create the filter on. |
MetricName | The name of the metric to emit. |
MetricNamespace | The namespace of the metric to emit. |
MetricValue | The value to emit for the metric. |
Unit | The unit to assign to the metric. |
Constructors
MetricFilterProps()
public MetricFilterProps()
Properties
DefaultValue
The value to emit if the pattern does not match a particular event.
public Nullable<double> DefaultValue { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
Default: No metric emitted.
Dimensions
The fields to use as dimensions for the metric.
public IDictionary<string, string> Dimensions { get; set; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.String>
Remarks
One metric filter can include as many as three dimensions.
Default: - No dimensions attached to metrics.
FilterName
The name of the metric filter.
public string FilterName { get; set; }
Property Value
System.String
Remarks
Default: - Cloudformation generated name.
FilterPattern
Pattern to search for log events.
public IFilterPattern FilterPattern { get; set; }
Property Value
LogGroup
The log group to create the filter on.
public ILogGroup LogGroup { get; set; }
Property Value
MetricName
The name of the metric to emit.
public string MetricName { get; set; }
Property Value
System.String
MetricNamespace
The namespace of the metric to emit.
public string MetricNamespace { get; set; }
Property Value
System.String
MetricValue
The value to emit for the metric.
public string MetricValue { get; set; }
Property Value
System.String
Remarks
Can either be a literal number (typically "1"), or the name of a field in the structure to take the value from the matched event. If you are using a field value, the field value must have been matched using the pattern.
If you want to specify a field from a matched JSON structure, use '$.fieldName', and make sure the field is in the pattern (if only as '$.fieldName = *').
If you want to specify a field from a matched space-delimited structure, use '$fieldName'.
Default: "1"
Unit
The unit to assign to the metric.
public Nullable<Unit> Unit { get; set; }
Property Value
System.Nullable<Unit>
Remarks
Default: - No unit attached to metrics.