org.eclipse.microprofile.metrics.annotation

## Annotation Type Gauge

    @InterceptorBinding
     @Retention(value=RUNTIME)
     @Target(value={METHOD,ANNOTATION_TYPE})
    public @interface Gauge

An annotation for marking a method or field as a gauge. The metric will be registered in the application MetricRegistry.

Given a method annotated with @Gauge like this:

          @Gauge(name = "queueSize")
         public int getQueueSize() {
             return queue.size;
         }

A gauge with the fully qualified class name + `queueSize` will be created which uses the annotated method's return value as its value.

### Required Element Summary

Required Elements
`String` `unit` The unit of the gauge.

### Optional Element Summary

Optional Elements
`boolean` `absolute` Denotes whether to use the absolute name or use the default given name relative to the annotated class.
`String` `description` The description of the gauge.
`String` `displayName` The human readable display name of the gauge.
`String` `name` The name of the gauge.
`String[]` `tags` The tags of the gauge.

### Element Detail

#### unit

    public abstract String unit

The unit of the gauge.

Returns:
  (Required) The unit of the gauge.
See Also:
  `Metadata`, `MetricUnits`

#### name

    public abstract String name

The name of the gauge.

Returns:
  The name of the gauge.

Default:
  ""

#### tags

    public abstract String[] tags

The tags of the gauge.

Returns:
  The tags of the gauge. Each `String` tag must be in the form of 'key=value'. If the input is empty or does not contain a '=' sign, the entry is ignored.
See Also:
  `Metadata`

Default:
  {}

#### absolute

    public abstract boolean absolute

Denotes whether to use the absolute name or use the default given name relative to the annotated class.

Returns:
  If `true`, use the given name as an absolute name. If `false` (default), use the given name relative to the annotated class.

Default:
  false

#### displayName

    public abstract String displayName

The human readable display name of the gauge.

Returns:
  The display name of the gauge.
See Also:
  `Metadata`

Default:
  ""

#### description

    public abstract String description

The description of the gauge.

Returns:
  The description of the gauge.
See Also:
  `Metadata`

Default:
  ""