package
0.0.0-20231018235809-90deddd72f8f
Repository: https://github.com/grailbio/reflow.git
Documentation: pkg.go.dev

# README

Reflow Metrics Library

The Reflow metrics library should be used to provide observability into Reflow.

Defining metrics

Metrics are defined in metrics.yaml. Each named dictionary in the metrics.yaml root array will produce a metric. Note that the name for a metric must be given in snake_case and contain only lowercase alpha characters. Metric configuration dictionaries can have the following fields:

  • Type

    • The following types of metrics are available.
      • counter - counters can only be incremented or reset to zero.
      • gauge - gauges can be incremented, decremented or set to an arbitrary value.
      • histogram - histograms can used to observe arbitrary values (discretized to a set of buckets configured at compilation).
  • Help

    • All metrics should be documented with a helpful help message. This field can be used by clients to provide documentation at query-time.
  • Labels

    • Labels give dimensionality to metrics. Labels are written in snake_case and can only contain lowercase alpha characters.
  • Buckets

    • Buckets is a special field available on the "histogram" metric type. Observations will be discretized to fit into these buckets, based on the implementation of the metrics client.

Regenerating metrics.go

After updating metrics.json, use the genmetrics utility binary to generate static the go package functions that are called to provide observations.

go run cmd/genmetrics/main.go metrics/metrics.yaml metrics

# Packages

No description provided by the author
No description provided by the author

# Functions

GetAllocsCompletedCountCounter returns a Counter to set metric allocs_completed_count (count of completed allocs).
GetAllocsCompletedSizeCounter returns a Counter to set metric allocs_completed_size (size of completed allocs).
GetAllocsLiveResourcesGauge returns a Gauge to set metric allocs_live_resources (resources of live allocs).
GetAllocsLiveSizeGauge returns a Gauge to set metric allocs_live_size (size of live allocs).
GetAllocsStartedCountCounter returns a Counter to set metric allocs_started_count (count of started allocs).
GetAllocsStartedSizeCounter returns a Counter to set metric allocs_started_size (size of started allocs).
GetDydbassocOpLatencySecondsHistogram returns a Histogram to set metric dydbassoc_op_latency_seconds (dydbassoc operation latency in seconds).
GetMemstatsHeapInuseBytesGauge returns a Gauge to set metric memstats_heap_inuse_bytes (bytes of memory used by in use heap spans).
GetMemstatsHeapObjectsGauge returns a Gauge to set metric memstats_heap_objects (current number of allocated heap objects).
GetMemstatsHeapSysBytesGauge returns a Gauge to set metric memstats_heap_sys_bytes (bytes of heap memory obtained from the OS).
GetMemstatsStackInuseBytesGauge returns a Gauge to set metric memstats_stack_inuse_bytes (bytes of memory used for stack spans).
GetMemstatsStackSysBytesGauge returns a Gauge to set metric memstats_stack_sys_bytes (bytes of stack memory obtained from the OS).
GetPoolAvailResourcesGauge returns a Gauge to set metric pool_avail_resources (available resources in a pool).
GetPoolAvailSizeGauge returns a Gauge to set metric pool_avail_size (available size in a pool).
GetPoolTotalResourcesGauge returns a Gauge to set metric pool_total_resources (total resources in a pool).
GetPoolTotalSizeGauge returns a Gauge to set metric pool_total_size (total size of a pool).
GetTasksCompletedCountCounter returns a Counter to set metric tasks_completed_count (count of completed tasks).
GetTasksCompletedSizeCounter returns a Counter to set metric tasks_completed_size (size of completed tasks).
GetTasksInProgressResourcesGauge returns a Gauge to set metric tasks_in_progress_resources (resources of tasks currently being processed).
GetTasksInProgressSizeGauge returns a Gauge to set metric tasks_in_progress_size (size of tasks currently being processed).
GetTasksStartedCountCounter returns a Counter to set metric tasks_started_count (count of started tasks).
GetTasksStartedSizeCounter returns a Counter to set metric tasks_started_size (size of started tasks).
GetTasksSubmittedCountCounter returns a Counter to set metric tasks_submitted_count (count of submitted tasks).
GetTasksSubmittedSizeCounter returns a Counter to set metric tasks_submitted_size (size of submitted tasks).
On returns true if there is a current Client associated with the provided context.
WithClient returns a context that emits trace events to the provided Client.

# Variables

No description provided by the author
No description provided by the author
No description provided by the author
NopClient is default metrics client that does nothing.

# Interfaces

Client is a sink for metrics.
Counter wraps prometheus.Counter.
Gauge wraps prometheus.Gauge.
Histogram wraps prometheus.Histogram.