This API documentation is for Ballerina 1.2.0. View API documentation for the latest release.

Record - observe : Metric

This represents the generic metric record that can represent both counter and gauge.


  • name string
  • Name of the metric.

  • desc string
  • Description of the metric.

  • tags map<string>
  • Tags associated with the metric.

  • metricType string
  • Type of the metric.

  • value int | float
  • Current value the metric.

  • summary Snapshot[]?
  • If the metric is configured with statistics config, then the calculated statistics of the metric.