metrics

package
v0.2.0-alpha-RC1 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package metrics is an internal package that provides helper functions for OpenCensus instrumentation in Open Match.

Copyright 2018 Google LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigureOpenCensusPrometheusExporter

func ConfigureOpenCensusPrometheusExporter(cfg *viper.Viper, views []*view.View)

ConfigureOpenCensusPrometheusExporter reads from the provided viper config's 'metrics' section to set up a metrics endpoint that can be scraped by Promethus for metrics gathering. The calling code can select any views it wants to register, from any number of libraries, and pass them in as an array.

func NewHook

func NewHook(m *stats.Int64Measure, ks tag.Key) log.Hook

NewHook returns a new log.Hook for counting log lines using OpenCensus.

Types

type Hook

type Hook struct {
	// contains filtered or unexported fields
}

Hook is a log hook that for counting log lines using OpenCensus.

func (Hook) Fire

func (h Hook) Fire(e *log.Entry) error

Fire is run every time log logs a line and increments the OpenCensus counter

func (Hook) Levels

func (h Hook) Levels() []log.Level

Levels returns all log levels, because we want the hook to always fire when a line is logged.

Jump to

Keyboard shortcuts

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