Package com.google.cloud.logging
Class Metric.Builder
java.lang.Object
com.google.cloud.logging.MetricInfo.Builder
com.google.cloud.logging.Metric.Builder
- Enclosing class:
- Metric
A builder for
Metric objects.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Creates aMetricInfoobject for this builder.setDescription(String description) Sets an optional description for this metric.Sets an advanced logs filter.Sets the name of the metric.
-
Method Details
-
setName
Description copied from class:MetricInfo.BuilderSets 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.- Specified by:
setNamein classMetricInfo.Builder
-
setDescription
Description copied from class:MetricInfo.BuilderSets an optional description for this metric. Used for documentation purpose.- Specified by:
setDescriptionin classMetricInfo.Builder
-
setFilter
Description copied from class:MetricInfo.BuilderSets 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.- Specified by:
setFilterin classMetricInfo.Builder- See Also:
-
build
Description copied from class:MetricInfo.BuilderCreates aMetricInfoobject for this builder.- Specified by:
buildin classMetricInfo.Builder
-