metricscharts

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 27, 2019 License: MIT Imports: 3 Imported by: 1

README

go-metrics-charts

This project provides real-time live charting of internal metrics for applications that use the rcrowley/go-metrics metrics library. It began as a fork of github.com/mkevac/debugcharts, until it seemed cleaner to keep it separate.

This is intended as a simple live view of metrics in a single process without the need for an entire metrics stack - it can be useful when developing and testing locally. All third party dependencies are loaded from a CDN to keep the amount of embedded data to a minimum.

Browser Compatibility

The javascript code is written in ES6, so it requires a modern browser. It's been tested in Safari 10 and Chrome 54.

Installation

go get github.com/aalpern/go-metrics-charts

Usage

import "github.com/aalpern/go-metrics-charts"

metricscharts.Register()

You must have metrics exposed via expvars, as rather than having a binary depedency on the metrics package, the UI works by hitting the /debug/metrics JSON endpoint exposed by that package.

import "github.com/rcrowley/go-metrics/exp"

exp.Exp(metrics.DefaultRegistry)

The live charts page will be registered at /debug/metrics/charts.

screenshot

TO-DO

  • better handling of long list of metrics
  • set refresh period
  • limit the data to a rolling window of data points
  • Chart options - add stacked area, display data points
  • Responsive chart
  • pause/restart
  • merge runtime stats into metrics list for unified UI
  • implement filtering of metrics list
  • URL handling/generation

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register()

Types

This section is empty.

Directories

Path Synopsis
Package bindata Code generated by go-bindata.
Package bindata Code generated by go-bindata.
cmd

Jump to

Keyboard shortcuts

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