Package com.google.cloud.logging
Class MetricInfo.Builder
- java.lang.Object
-
- com.google.cloud.logging.MetricInfo.Builder
-
- Direct Known Subclasses:
Metric.Builder
- Enclosing class:
- MetricInfo
public abstract static class MetricInfo.Builder extends Object
A builder forMetricInfo
objects.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract MetricInfo
build()
Creates aMetricInfo
object for this builder.abstract MetricInfo.Builder
setDescription(String description)
Sets an optional description for this metric.abstract MetricInfo.Builder
setFilter(String filter)
Sets an advanced logs filter.abstract MetricInfo.Builder
setName(String name)
Sets the name of the metric.
-
-
-
Method Detail
-
setName
public abstract MetricInfo.Builder setName(String name)
Sets the name of the metric. Example:severe-errors
. Metric identifiers are limited to 1000 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.
-
setDescription
public abstract MetricInfo.Builder setDescription(String description)
Sets an optional description for this metric. Used for documentation purpose.
-
setFilter
public abstract MetricInfo.Builder setFilter(String filter)
Sets an advanced logs filter. The value of the metric is the number of log entries that match this filter. Example:logName=projects/my-projectid/logs/syslog AND severity>=ERROR
.- See Also:
- Advanced Log Filters
-
build
public abstract MetricInfo build()
Creates aMetricInfo
object for this builder.
-
-