Back to godoc.org

Package versions

v0.0.0-...-d4769a7
Latest Go to latest

The latest major version is .

Published: Aug 1, 2020 | License: Apache-2.0 | Module: github.com/luci/luci-go

Overview

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

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.

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier