tevjef / go-runtime-metrics Goto Github PK
View Code? Open in Web Editor NEWCollect golang runtime metrics, pushing to InfluxDB or pulling with Telegraf
License: MIT License
Collect golang runtime metrics, pushing to InfluxDB or pulling with Telegraf
License: MIT License
thank u.
Would it be possible to add an example to the repository.
Simple Helloworld example with Grafana included.
It would be awesome if you included the Grafana dashboard you setup in the screenshot!
As this is to be used as a library I think having the need to call flag.Parse()
to be a bad practice. Instead you could check for an environment variable or expose the variable directly which can be set after importing the package.
The batch points data is never cleared; not even on a successful write. Therefore you'll actually upload n*(n+1)/2
total batches after n
batches and memory will also continuously grow.
Potential fix: joa@41115d4
Hi,
First: thanks for that nice package !
I wanted to try telegraf and that's what I've got:
./telegraf -config telegraf.conf
2017-10-06T18:14:38Z I! Starting Telegraf v1.5.0~59bb31e7
2017-10-06T18:14:38Z I! Loaded outputs: influxdb
2017-10-06T18:14:38Z I! Loaded inputs: inputs.influxdb
2017-10-06T18:14:38Z I! Tags enabled: host=iidor.dhcp.lyon.intranet
2017-10-06T18:14:38Z I! Agent Config: Interval:10s, Quiet:false, Hostname:"iidor.dhcp.lyon.intranet", Flush Interval:10s
2017-10-06T18:14:40Z E! Error in plugin [inputs.influxdb]: [url=http://127.0.0.1:9090/debug/vars]: invalid character '<' looking for beginning of value
And yes, http://127.0.0.1:9090/debug/vars returns a 404 while graph are correctly displayed in grafana at http://127.0.0.1:9090
This is the config I've got:
# Global tags can be specified here in key="value" format.
[global_tags]
# dc = "us-east-1" # will tag all metrics with dc=us-east-1
# rack = "1a"
## Environment variables can be used as tags, and throughout the config file
# user = "$USER"
# Configuration for telegraf agent
[agent]
interval = "10s"
round_interval = true
metric_batch_size = 1000
metric_buffer_limit = 10000
collection_jitter = "0s"
flush_interval = "10s"
flush_jitter = "0s"
precision = ""
debug = false
quiet = false
logfile = ""
hostname = ""
omit_hostname = false
[[inputs.influxdb]]
urls = ["http://127.0.0.1:9090/debug/vars"]
[[outputs.influxdb]]
urls = ["http://127.0.0.1:8086"] # required
database = "stats" # required
timeout = "5s"
My package includes everything at startup:
package ogle
import (
"fmt"
"time"
metrics "github.com/tevjef/go-runtime-metrics"
_ "github.com/tevjef/go-runtime-metrics/expvar"
)
func init() {
metrics.DefaultConfig.CollectionInterval = time.Second
if err := metrics.RunCollector(metrics.DefaultConfig); err != nil {
fmt.Println(err)
}
}
One more time, graphs are ok.
Can you tell me what I'm doing wrong ?
Hey there I realize you haven't touched this project in a while but it no longer works with the latest versions of influxdb and grafana. The new influxdb client to work with the flux language is here. It would be super cool if you could support it because this is a super useful tool! Thank You!
Hi there!
First of all, I want to say that this lib looks awesome and provides helpful insights of our internal golang apps.
The only thing we miss is the ability to push metrics to telegraf using UDP (which is much lighter than tcp HTTP connections). Is there any plan to support it?
Thanks again for this work! ๐
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.