Giter Club home page Giter Club logo

go-metrics-influxdb's People

Contributors

crosbymichael avatar ksophocleous avatar nitti avatar rread avatar tehsphinx avatar tresgolpes avatar vrischmann avatar yavosh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

go-metrics-influxdb's Issues

Improper modification of global tags when bucketing histogram, meter, timer metrics

When creating tags for the purpose of bucketing histogram, meter, and timer metrics, the library improperly modifies the global tag set:

https://github.com/vrischmann/go-metrics-influxdb/blob/master/influxdb.go#L151
https://github.com/vrischmann/go-metrics-influxdb/blob/master/influxdb.go#L173
https://github.com/vrischmann/go-metrics-influxdb/blob/master/influxdb.go#L207

I'm sure the intent here was to copy the existing tag set, but maps are a reference type. The result is that the bucket tag that is added for histogram, meter, and timer metrics is also applied to counter and gauge metrics.

The correct way to handle this is to explicitly copy the existing map:

these_tags := map[string]string{}
for tk, tv := range r.tags {
    these_tags[tk] = tv
}

I'll open a PR with the fix.

go modules

@vrischmann If you don't mind, I can create a PR to add go modules to this project. Which version should I give it? v0.1.0?

influxdb too many file

hello,i find if i get server info.after long time.linux show too many ESTABLISHED.

package main

import (
	"time"
	"github.com/rcrowley/go-metrics"
	"github.com/vrischmann/go-metrics-influxdb"
)


func main() {
	r := metrics.NewRegistry()
	metrics.RegisterDebugGCStats(r)
	metrics.RegisterRuntimeMemStats(r)

	go metrics.CaptureDebugGCStats(r, time.Second *5)
	go metrics.CaptureRuntimeMemStats(r, time.Second *5)

	for {
		go influxdb.InfluxDB(
			r,                             // metrics registry
			time.Second * 5,                 // how often
			"***", // InfluxDB url
			"***",                  // InfluxDB database name
			"",                            // InfluxDB user
			"",                            // InfluxDB password
		)
		time.Sleep(time.Second * 3)
	}
}

Incorrect Percentiles reporting

Hi,

It looks like when reporting histogram values - all percentiles will be set to same value.

Here's how go-metrics logger fetches the percentiles:
ps := h.Percentiles([]float64{0.5, 0.75, 0.95, 0.99, 0.999})

Here's influxdb.go:
"p999": m.Percentile(99.9),
"p9999": m.Percentile(99.99),

From traffic capture. Note the pNN values:

count=481999i,m1=999.9992707686223,m15=998.8201711297105,m5=999.589420684841,max=1181835i,mean=127654.4280155642,meanrate=999.9936221298891,min=81662i,p50=1181835,p75=1181835,p95=1181835,p99=1181835,p999=1181835,p9999=1181835,stddev=76492.17168321775,variance=5851052328.814858 1445863754555784700

when i use metrics.Histogram

when i use metrics.Histogram

总数一直相加,count 一直直线增长。 应该调用metrics.clear() 清除一下吧?

我可否提一个pr,合并一下?

inconsistent data type for some metric types

according to https://community.influxdata.com/t/how-to-solve-type-conflicts/8473, one field under the same measurement (regardless of the different buckets) needs to have same field type.

otherwise, we might have errors as shown below

2020/01/21 12:28:10 unable to send metrics to InfluxDB. err={"error":"partial write: field type conflict: input field \"process-time.histogram\" on measurement \"item-pipeline\" is type float, already exists as type integer dropped=10"}

The fix would be to unify the same data type for each field. For example, for Histogram, we could do the following:

fields := map[string]interface{}{
	"count": float64(ms.Count()),
	"m1":    ms.Rate1(),
	"m5":    ms.Rate5(),
	"m15":   ms.Rate15(),
	"mean":  ms.RateMean(),
}

Please approve the problem and solution and I can create the MR for it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.