You don't want to include any sort of timestamp otherwise you won't be 
replacing the previous set of results with the new ones. 

On 22 August 2021 20:36:27 BST, David Leonhartsberger <leozi...@gmail.com> 
wrote:
>First of all, thanks a lot for the answers.
>
>I think I mixed up some names when explaining my use case.
>I asked for which "job-name" and "instance-id" to use when pushing the 
>metrics. Here I wasnt talking about the labels which are attached to a 
>metric, instead I was talking about the "group" to use when pushing the 
>metrics.
>
>*Example:*
>
>*HTTP API:*
>http://pushgateway.example.org:9091/metrics/job/jobA/instance/customerx-2021-01-01
>
>*Java API:*
>String job = "jobA"
>String instance = "customerX-2021-01-01"
>
>PushGateway pg = ...
>pg.pushAdd(registry, job, instance)
>
>
>Here I am not sure if I even need to specify an "instance" or if its enough 
>to just use "job". Is it a good idea to also specify an "instance", and if 
>so what should I use here?
>And I am also not sure if I really need to delete the metrics from the 
>pushgateway after some time. In my case I only push a handful of metrics 
>every day (so its really little data)
>
>
>Alerting: 
>Ideally I want to create alerts that tell me which instance of the job has 
>failed, so that I know for which date I need to re-run the job.
>
>Stuart Clark schrieb am Sonntag, 22. August 2021 um 20:02:50 UTC+2:
>
>> It sounds like you just need a label for the customer (X, Y or Z) and the 
>> job (A, B or C). You don't want anything about timestamps in the labels. 
>>
>> On 22 August 2021 16:15:01 BST, David Leonhartsberger <leoz...@gmail.com> 
>> wrote:
>>>
>>> I have red the documentation about prometheus and the pushgateway but I 
>>> still dont understand how I am supposed to "properly" setup the prometheus 
>>> stack to get the metrics of my jobs.
>>>
>>> Use case:
>>> We have a couple of jobs which run every day for about 30-90 seconds.
>>> So the following instances are run every day:
>>> - JobA for customerX
>>> - JobA for customerY
>>> - JobB for customerX
>>> - JobC for customerZ
>>>
>>> So for JobA there are 2 "instances" running every day, each instance 
>>> needs to collect some data for one of our customers.
>>>
>>> It seems the pushgateway is the way to go here as the jobs are not bound 
>>> to any machine (k8s cronjob scheduled on some node in the pool) and the 
>>> average runtime is about 1 minute each.
>>>
>>> Two things still confuse me a lot:
>>> 1. what "job-name" and "instance-id" (if any) should I use when pushing 
>>> the metrics,
>>> 2. when and how should I delete the metrics from the pushgateway
>>>
>>> About 1)
>>> For the "job-name" I was going to use "JobA", "JobB" etc
>>> For "instance-id" I was thinking about using "customerX-$timestamp"
>>>
>>> About 2)
>>> I am really clueless here. 
>>>
>>> I guess if I dont use an "instance-id" I can delete all metrics by 
>>> "job-name" once I dont need the job anymore but this could be years in the 
>>> future.. 
>>>
>>> If I use an "instance-id", the only way to delete the metrics (without 
>>> keeping track of what instance-ids where used) is to delete all metrics via 
>>> the admin api. So it seems here I either need to keep state or delete 
>>> everything, both doesnt sound right..
>>>
>>>
>>> I would really appreciate some help here.
>>>
>>> Br David
>>>
>>> -- 
>> Sent from my Android device with K-9 Mail. Please excuse my brevity.
>>
>
>-- 
>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 prometheus-users+unsubscr...@googlegroups.com.
>To view this discussion on the web visit 
>https://groups.google.com/d/msgid/prometheus-users/3a012bd9-ae2e-41c6-99e2-ca4374bdc356n%40googlegroups.com.

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

-- 
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 prometheus-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/3BF0E515-C363-4256-B5C9-DC2867DBEA65%40Jahingo.com.

Reply via email to