tsmon

package
v0.0.0-...-678bb0e Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2017 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Overview

Package tsmon adapts common/tsmon library to GAE environment.

It configures tsmon state with a monitor and store suitable for GAE environment and controls when metric flushes happen.

Timeseries metrics are gathered automatically by the tsmon middleware and staged in memory for export. Periodically, an unlucky single handler will be chosen to perform this export at the end of its operation.

A cron task MUST also be installed if metrics are enabled. The task assigns and manages the task number assignments for active instances. If this cron task is not installed, instances will not get IDs and will be unable to send metrics. The cron task should be configured to hit: "/internal/cron/ts_mon/housekeeping" every minute.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InstallHandlers

func InstallHandlers(r *router.Router, base router.MiddlewareChain)

InstallHandlers installs HTTP handlers for tsmon routes.

Types

type State

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

State holds the configuration of the tsmon library for GAE.

Define it as a global variable and inject it in the request contexts using State.Middleware().

It will initialize itself from the tsmon state in the passed context on a first use, mutating it along the way. Assumes caller is consistently using contexts configured with exact same tsmon state (in a vast majority of cases it would be global tsmon state that corresponds to context.Background, but unit tests may provide its own state).

Will panic if it detects that caller has changed tsmon state in the context between the requests.

func (*State) Middleware

func (s *State) Middleware(c *router.Context, next router.Handler)

Middleware is a middleware that must be inserted into the middleware chain to enable tsmon metrics to be send on AppEngine.

Jump to

Keyboard shortcuts

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