luci: go.chromium.org/luci/common/tsmon/versions Index | Files

package versions

import "go.chromium.org/luci/common/tsmon/versions"

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.

Index

Package Files

versions.go

func Register Uses

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 Uses

func Report(c context.Context)

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

Package versions imports 4 packages (graph) and is imported by 4 packages. Updated 2018-12-14. Refresh now. Tools for package owners.