Very simple charts with some debug data for Go programs

Overview

debugcharts Build Status

Go memory debug charts.

This package uses Plotly chart library. It is open source and free for use.

Installation

go get -v -u github.com/mkevac/debugcharts

Usage

Just install package and start http server. There is an example program here.

Then go to http://localhost:8080/debug/charts. You should see something like this:

Data is updated every second. We keep data for last day.

User https://github.com/dgryski/ proposed interesing way for turning debugcharts on/off for your project:

You can add tagged file like this in your code

// +build debugcharts

package main

import _ "github.com/mkevac/debugcharts"

If you want to use debugcharts, then build your project with -tags debugcharts

Development

I use bindata to pack binary files into executable. Run make to rebuild.

Issues
  • http.ServeMux

    http.ServeMux

    Hi, remove init() and create func that will returned http.ServeMux server with all necessary handlers to allow developers to choose addr and port. And hide Assert funcs (if you have not many time let me do this)

    opened by ivan1993spb 9
  • no charts, errors in console

    no charts, errors in console

    when accessing charts i see only one empty chart and a bunch of errors in console:

    Uncaught TypeError: Cannot read property 'length' of null
        at new m (plotly-latest.min.js:7)
        at m (plotly-latest.min.js:7)
        at Object.plot (plotly-latest.min.js:7)
        at d (plotly-latest.min.js:7)
        at Object.r.plot (plotly-latest.min.js:7)
        at r.drawData (plotly-latest.min.js:7)
        at Object.l.syncOrAsync (plotly-latest.min.js:7)
        at Object.r.plot (plotly-latest.min.js:7)
        at Object.r.newPlot (plotly-latest.min.js:7)
        at Object.success (main.js:26)
    m @ plotly-latest.min.js:7
    m @ plotly-latest.min.js:7
    plot @ plotly-latest.min.js:7
    d @ plotly-latest.min.js:7
    r.plot @ plotly-latest.min.js:7
    r.drawData @ plotly-latest.min.js:7
    l.syncOrAsync @ plotly-latest.min.js:7
    r.plot @ plotly-latest.min.js:7
    r.newPlot @ plotly-latest.min.js:7
    (anonymous) @ main.js:26
    j @ jquery-2.1.4.min.js:2
    fireWith @ jquery-2.1.4.min.js:2
    x @ jquery-2.1.4.min.js:4
    (anonymous) @ jquery-2.1.4.min.js:4
    load (async)
    send @ jquery-2.1.4.min.js:4
    ajax @ jquery-2.1.4.min.js:4
    n.(anonymous function) @ jquery-2.1.4.min.js:4
    getJSON @ jquery-2.1.4.min.js:4
    (anonymous) @ main.js:17
    j @ jquery-2.1.4.min.js:2
    fireWith @ jquery-2.1.4.min.js:2
    ready @ jquery-2.1.4.min.js:2
    I @ jquery-2.1.4.min.js:2
    4plotly-latest.min.js:7 Uncaught Error: gd.data must be an array
        at plotly-latest.min.js:7
        at I (plotly-latest.min.js:7)
        at Object.t [as extendTraces] (plotly-latest.min.js:7)
        at WebSocket.ws.onmessage (main.js:117)
    

    may be chart lib was updated?

    opened by Vasiliy-Bondarenko 3
  • calls to log.Fatal() make me nervous

    calls to log.Fatal() make me nervous

    Errors happen all the time at scale. I'm hesitant to deploy a service to production built with this knowing that log.Fatal() might be called and my application would exit. I think log.Println/return pair would be sufficient in most of the cases.

    Alternatively have it configurable with a package-level variable.

    opened by dgryski 3
  • run error

    run error

    panic: runtime error: invalid memory address or nil pointer dereference
    [signal 0xc0000005 code=0x0 addr=0x0 pc=0x7ad1a0]
    
    goroutine 19 [running]:
    github.com/mkevac/debugcharts.(*server).gatherData(0xa9bc60)
            C:/golang/gowork/src/github.com/mkevac/debugcharts/debugcharts.go:112 +0x210
    created by github.com/mkevac/debugcharts.init.1
            C:/golang/gowork/src/github.com/mkevac/debugcharts/debugcharts.go:158 +0x2f9
    exit status 2
    
    opened by lengrongfu 2
  • set default log Flag?

    set default log Flag?

    when use this found default log Prefix not exists, like

    log.Println("xxxx")
    
    2017/09/04 13:25:10 xxxx
    2017/09/04 13:25:10 xxxx
    

    to

    xxxx
    xxxx
    
    opened by ddatsh 0
  • Update gopsutil to support darwin/arm64

    Update gopsutil to support darwin/arm64

    The old version of gopsutil doesn't seem to support Apple Silicon (darwin/arm64), causing debugcharts to fail to compile entirely on that platform:

    go: downloading github.com/gorilla/handlers v1.4.2
    go: downloading golang.org/x/sys v0.0.0-20191220220014-0732a990476f
    # github.com/shirou/gopsutil/cpu
    ../../../../pkg/mod/github.com/shirou/[email protected]+incompatible/cpu/cpu_darwin_cgo.go:13:5: warning: 'TARGET_OS_MAC' is not defined, evaluates to 0 [-Wundef-prefix=TARGET_OS_]
    # github.com/shirou/gopsutil/process
    ../../../../pkg/mod/github.com/shirou/[email protected]+incompatible/process/process_darwin.go:559:34: undefined: KinfoProc
    ../../../../pkg/mod/github.com/shirou/[email protected]+incompatible/process/process_darwin.go:560:8: undefined: KinfoProc
    ../../../../pkg/mod/github.com/shirou/[email protected]+incompatible/process/process_darwin.go:573:32: undefined: KinfoProc
    ../../../../pkg/mod/github.com/shirou/[email protected]+incompatible/process/process_darwin.go:577:62: undefined: KinfoProc
    

    I am therefore proposing to update that dependency, which seems to have resolved the problem for me.


    Thank you for this great project!

    opened by radeksimko 0
  • data race

    data race

    ============================= WARNING: DATA RACE Write at 0x000002c31d28 by goroutine 25: aithub.com/mkevac/debuacharts. (*server) gatherData0 /go/pkg/mod/github.com/mkevac/[email protected]/debugcharts.go:125+0x472 github.com/mkevac/debugcharts.init.o•dwrap•1() /go/pkg/mod/github.com/mkevac/[email protected]/debugcharts.go:193+0x39 Previous read at 0x000002c31d28 by goroutine 962: [failed to restore the stack] Goroutine 25 (running) created at: github.com/mkevac/debugcharts.init.0( /go/pkg/mod/github.com/mkevac/[email protected]/debugcharts.go:193+0x507

    opened by yzhlove 0
Owner
Marko Kevac
Marko Kevac
Simple logger for Go programs. Allows custom formats for messages.

go-logger A simple go logger for easy logging in your programs. Allows setting custom format for messages. Preview Install go get github.com/apsdehal/

Amanpreet Singh 276 Jun 14, 2022
Very powerful server agent for collecting & sending logs & metrics with an easy-to-use web console.

logkit-community 中文版 Introduce Very powerful server agent for collecting & sending logs & metrics with an easy-to-use web console. logkit-community De

Qiniu Cloud 1.2k Aug 12, 2022
Some tests and examples with goroutines and channels

goroutine-playground Some tests and examples with goroutines and channels simpleAsyncCalls Runs functions in background and doesn't wait for results a

Filipe Alves 1 Feb 9, 2022
Logger - Some implementations for Logs written in Go

Logger will be a tool for sending logs to different places in your software. Rig

Carlos Gaona 1 Feb 16, 2022
Implements a deep pretty printer for Go data structures to aid in debugging

go-spew Go-spew implements a deep pretty printer for Go data structures to aid in debugging. A comprehensive suite of tests with 100% test coverage is

Dave Collins 5.2k Aug 16, 2022
A flexible process data collection, metrics, monitoring, instrumentation, and tracing client library for Go

Package monkit is a flexible code instrumenting and data collection library. See documentation at https://godoc.org/gopkg.in/spacemonkeygo/monkit.v3 S

Space Monkey Go 466 Aug 10, 2022
The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.

The open-source platform for monitoring and observability. Grafana allows you to query, visualize, alert on and understand your metrics no matter wher

Grafana Labs 50.5k Aug 19, 2022
Open source framework for processing, monitoring, and alerting on time series data

Kapacitor Open source framework for processing, monitoring, and alerting on time series data Installation Kapacitor has two binaries: kapacitor – a CL

InfluxData 2.2k Aug 13, 2022
Golang beautify data display for Humans

Golang beautify data display for Humans English 简体中文 Usage Examples package main import ( ffmt "gopkg.in/ffmt.v1" ) func main() { example() } typ

ffmt 275 Jul 26, 2022
pprof is a tool for visualization and analysis of profiling data

Introduction pprof is a tool for visualization and analysis of profiling data. pprof reads a collection of profiling samples in profile.proto format a

Google 5.7k Aug 10, 2022
Litter is a pretty printer library for Go data structures to aid in debugging and testing.

Litter Litter is a pretty printer library for Go data structures to aid in debugging and testing. Litter is provided by Sanity: The Headless CMS Const

Sanity 1.3k Aug 2, 2022
Visualise Go program GC trace data in real time

This project is no longer maintained I'm sorry but I do not have the bandwidth to maintain this tool. Please do not send issues or PRs. Thank you. gcv

Dave Cheney 1.1k Aug 11, 2022
Parametrized JSON logging library in Golang which lets you obfuscate sensitive data and marshal any kind of content.

Noodlog Summary Noodlog is a Golang JSON parametrized and highly configurable logging library. It allows you to: print go structs as JSON messages; pr

Gyoza Tech 37 Apr 19, 2022
Interfaces for LZ77-based data compression

Pack Interfaces for LZ77-based data compression. Introduction Many compression libraries have two main parts: Something that looks for repeated sequen

Andy Balholm 3 Oct 19, 2021
mtail - extract internal monitoring data from application logs for collection into a timeseries database

mtail - extract internal monitoring data from application logs for collection into a timeseries database mtail is a tool for extracting metrics from a

Google 3.3k Aug 9, 2022
Go Huobi Market Price Data Monitor

火币(Huobi)价格监控 由于部分交易对火币官方未提供价格监控,因此写了个小程序,长期屯币党可以用它来提醒各种现货价格。 该工具只需要提前安装Go环境和Redis即可。 消息推送使用的「钉钉」,需要提前配置好钉钉机器人(企业群类型、带webhook的机器人)。 使用方法 下载本项目 拷贝根目录下

ROC 5 Jul 21, 2022
Beta tool to normalize Orbit member data

Orbit Normalize Member Data Thanks for checking out my handy tool to work with Orbit's api. Everything is written in go and will continue to be update

Peter ONeill 2 Sep 16, 2021
Secure logger in Go to avoid output sensitive data in log

zlog A main distinct feature of zlog is secure logging that avoid to output secret/sensitive values to log. The feature reduce risk to store secret va

Masayoshi Mizutani 23 May 2, 2022
Go-bqstreamer - Stream data into Google BigQuery concurrently using InsertAll()

Kik and me (@oryband) are no longer maintaining this repository. Thanks for all the contributions. You are welcome to fork and continue development. B

Kik 132 Oct 18, 2021