Git Product home page Git Product logo

Comments (7)

ylwangs avatar ylwangs commented on April 28, 2024

Clone does the new application for a piece of memory and then returns

from cloudprober.

manugarg avatar manugarg commented on April 28, 2024

Good catch, @MrDragon1122. This Clone() is indeed unnecessary. I had a change to fix it long time ago, but didn't follow through and forgot about it :)

Do you want to send a PR?

from cloudprober.

ylwangs avatar ylwangs commented on April 28, 2024

Thanks for your guidance.
I also found a problem in the test, that is, the data in the Prometheus interface may be stale. If the prometheus database receives older data (such as 7 days ago), it will report an error. Therefore, the time should be added when the interface writes data, and the old data is not sent.

	if ps.c.IncludeTimeStamp {
		ps.dataWriter = func(w io.Writer, pm *promMetric, key string) {
			**if promTime(time.Now())-pm.data[key].timestamp < 60*60000 {**
				fmt.Fprintf(w, "%s %s %d\n", key, pm.data[key].value, pm.data[key].timestamp)
			}
		}
	} else {
		ps.dataWriter = func(w io.Writer, pm *promMetric, key string) {
			**if promTime(time.Now())-pm.data[key].timestamp < 60*60000 {**
				fmt.Fprintf(w, "%s %s\n", key, pm.data[key].value)
			}
		}
	}

from cloudprober.

manugarg avatar manugarg commented on April 28, 2024

@MrDragon1122

It's only a non-default option to not specify timestamp in prometheus surfacer. We added that because someone had an issue exporting data because of time-synchronization issues.

Am I understanding your concern correctly?

from cloudprober.

manugarg avatar manugarg commented on April 28, 2024

Ah, I see now. You're saying that we should not export data that is too old (especially when we are exporting timestamp with the data) as that may make prometheus reject all data instead of just the one that is old. That seems like a fair point. Let me think more about that.

from cloudprober.

manugarg avatar manugarg commented on April 28, 2024

@MrDragon1122 Can you point me to the prometheus documentation or code that says that it will reject the whole scrape if a metric has a timestamp older than 7d. Or, let me know if I didn't understand the issue clearly.

Also, cloudprober, by itself, re-exports all the relatively unchanging sysvar values, e.g. hostname, environment variables, etc and all the system probes should also keep generating new data unless there is a bug. I was wondering how did you run into a case where data was older than 7 days.

Also, I think we should file another issue for the prometheus surfacer issue.

Thanks in advance.
Manu

from cloudprober.

manugarg avatar manugarg commented on April 28, 2024

Committed 5d59e2c to fix the Clone() issue.

@MrDragon1122 Can you please create a different issue for the prometheus question. I'd do it myself but I think I am not clear about what's the real issue there. Appreciate you looking at it.

Thanks,
Manu

from cloudprober.

Related Issues (20)

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.