Hi  Julius Volz, 
Thanks for the explanation got the clear picture of the working of 
Prometheus, It works fine in my local computer, when I host the Exporter to 
the AWS instance, I am getting only the 2 hours of data, unlikely in local 
it works for any number of hours(Getting the data uninterrupted when the 
Exporter server is up), I think I am missing something while handling the 
server on AWS Instance, Herby I am including the code for the server, 
Kindly help me out to resolve that.

Code:
import prometheus_client
class ABCD:
    def function:
        yield metric

if __name__ == '__main__':

    start_http_server(int(sys.argv[1]))
    REGISTRY.register(ABCD())
    while True: time.sleep(1)

Best,
Dhanush Eswar G

On Friday, January 22, 2021 at 11:40:19 PM UTC+5:30 [email protected] 
wrote:

> Hi Dhanush,
>
> The way Prometheus works (usually) is that it scrapes the current value of 
> all metrics from a target / exporter. So a /metrics endpoint does not 
> provide historical data, the history only gets built up by Prometheus 
> itself as a process of scraping and storing current values periodically in 
> the time series database. So if you only have been scraping for 2h, it's 
> expected that you would only get 2h of data in your TSDB.
>
> Regards,
> Julius
>
> On Fri, Jan 22, 2021 at 10:37 AM Dhanush Eswar <[email protected]> 
> wrote:
>
>> Hi,
>> I am new to prometheus, I am using prometheus_client python package for 
>> exporting metrics and I hosted the python program on some Amazon EC2 
>> instance, I have been receiving the data from the metrics for only 2 hours 
>> and the Graph of the Grafana shows only that data(for 2 hours), Can anyone 
>> tell why its happening in such a way and provide me some tips.
>>
>> Best,
>> Dhanush Eswar G
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Prometheus Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/prometheus-users/8f19c390-ad71-4c21-85ea-f0159c52a2b7n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/prometheus-users/8f19c390-ad71-4c21-85ea-f0159c52a2b7n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>
>
> -- 
> Julius Volz
> PromLabs - promlabs.com
>

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/fa59379c-05eb-437f-bca9-6214849484e5n%40googlegroups.com.

Reply via email to