Version: v0.0.0-...-51f9457 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Jul 9, 2021 License: Apache-2.0 Imports: 4 Imported by: 0



Package versions allows processes to report string-valued metrics with versions of various libraries they link with.

The metric is named 'luci/components/version', and it has single field 'component' that defines the logical name of the component whose version is reported by the metric value.

Having such metrics allows to easily detect processes that use stale code in production.

Various go packages can register their versions during 'init' time, and all registered version will be flushed to monitoring whenever 'Report' is called.



This section is empty.


This section is empty.


func Register

func Register(component, version string)

Register tells the library to start reporting a version for given component.

This should usually called during 'init' time.

The component name will be used as a value of 'component' metric field, and the given version will become the actual reported metric value. It is a good idea to use a fully qualified go package name as 'component'.

func Report

func Report(c context.Context)

Report populates 'luci/components/version' metric with versions of all registered components.


This section is empty.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL