QuestionQ10Verified/Instrumentation and ExportersCopy linkReport a problemAsk AstroTutorSave questionWhat is the best method for exposing a timestamp from your application?AWith a constant metric of value 1 and the timestamp as label.BWith a constant metric of value 1 and the timestamp as metric timestamp.CWith a gauge that has the timestamp as value.DWith a counter that is increased to the correct value.Show AnswerAnswerExplanationExport the Unix timestamp as the value of a gauge. Gauges can be set to a current state value, and Prometheus recommends exporting an event timestamp rather than a derived elapsed-time value; elapsed time can then be calculated with time() - my_timestamp_metric.Learn morePrometheus instrumentation practicesPrometheus metric typesShow comments0Show commentsCommunity DiscussionNo comments yet. Be the first to start the discussion!
Community Discussion