Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a issue about prometheus metrics timestamp and for great response ! thank u very much ! #4152

Closed
annan211 opened this Issue May 8, 2018 · 2 comments

Comments

Projects
None yet
3 participants
@annan211
Copy link

annan211 commented May 8, 2018

#Hi , everybody ,I have a big problem about Prometheus when I send some metrics data to pushgateway
With simpleclient_pushgateway java API 0.3.0

The problem is I can not send metrics data with timestamp , but I need it so much .

I have coverd DropwizardExports class with PromDropwizardExports and override fromCounter / fromGauge / fromHistogram / fromTimers and
Add timestamp to Sample

Ex :

List fromCounter(String dropwizardName, Counter counter) {
String name = sanitizeMetricName(dropwizardName);
Sample sample = new Sample(name, new ArrayList(), new ArrayList(),
(new Long(counter.getCount())).doubleValue(),System.currentTimeMillis());
LOGGER.info("Counter Sample is : " + sample);
return Arrays.asList(new MetricFamilySamples(name, Type.GAUGE, getHelpMessage(dropwizardName, counter),
Arrays.asList(sample)));
}

, but it don not work , ti is very important ,I wait for your great response !

@FUSAKLA

This comment has been minimized.

Copy link
Contributor

FUSAKLA commented May 8, 2018

I think pushing with timestamp is rejected since pushgateway version 0.4.0 (see changelog)

More info can be found here in this issue prometheus/pushgateway#109

@lock

This comment has been minimized.

Copy link

lock bot commented Mar 22, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Mar 22, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.