Skip to content
This repository was archived by the owner on Sep 1, 2024. It is now read-only.
This repository was archived by the owner on Sep 1, 2024. It is now read-only.

No data in counter timeseries #62

Open
@marcin-kasinski

Description

@marcin-kasinski

I have simple spring boot application.

My reporter:


ScheduledReporter reporter = InfluxdbReporter.forRegistry(metricRegistry)
//				    .protocol(new HttpInfluxdbProtocol("http", "monitoring-influxdb", 8086, "admin", "53CR3TP455W0RD", "metrics"))
					//servicename.namespace.svc.cluster.local
				    .protocol(new HttpInfluxdbProtocol("http", "monitoring-influxdb.kube-system.svc.cluster.local", 8086, "admin", "53CR3TP455W0RD", "metrics"))
				    .prefixedWith("services.microservice." + appName + "." + hostname)
				    .convertRatesTo(TimeUnit.SECONDS)
				    .convertDurationsTo(TimeUnit.MILLISECONDS)
				    .filter(MetricFilter.ALL)
//				    .skipIdleMetrics(false)
//				    .tag("cluster", "CL01")
//				    .tag("client", "OurImportantClient")
//				    .tag("hostname", hostname)
//				    .transformer(new CategoriesMetricMeasurementTransformer("module", "artifact"))
				    .build();
				reporter.start(30, TimeUnit.SECONDS);


Constructor

metricRegistry.register("MKCustomGaugeIndex",             new Gauge<Integer>() {
    @Override
    public Integer getValue() {
index++;
//  	  int randomNum = ThreadLocalRandom.current().nextInt(0, 300 + 1);
  	  System.out.println(new Date ()+" MKCustomGaugeXYZ generated "+index );
        return (int) new Integer(index);
    }
})
	;

In my rest code I have gauges and counters


public User getByEmail(@RequestParam(value="email", defaultValue=".")String email) 

{
....
	//------------------------ custom counter ------------------------//
	Counter mkCustomCounter = metricRegistry.counter("mkCustomCounter");
	mkCustomCounter .inc();
	//------------------------ custom counter ------------------------//
	Timer t=metricRegistry.timer("endpoint.MKget-by-email");
	Timer.Context c =t.time();
...
 this.counterService.increment("get-by-email.MKtxnCount");
 this.counterService.increment("get-by-email.MKtxnCount2");
	
 this.gaugeService.submit("get-by-email.MKcustomgauge", randomNum );
 this.gaugeService.submit("get-by-email.MKcustomgauge2", randomNum *2);

c.stop();
		
}


In infuxdb I can see that I have all timesieries, but data only in gauge timesies.
Counter timeseries are empty.

I,ve tested my code with two reporter, your influxdb and graphite.

I can see that this issue exsists only with influxdb rerpoter.
In graphite I have all data (gauges and counters).
In influxdb I have all timeseries definition but data only in gauges

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions