> this is the timestamp generated for the above custom metric:
> value: 20211011084811

I've seen this before in another thread.  This is a useless metric.  You 
need to change it to be the number of seconds since epoch (it's a custom 
metric, so you can change it).

Then you can query it like this:

(time() - argo_workflows_custom_start_time_gauge_workflow) < 3600

to get all workflows which started in the last hour.

On Wednesday, 13 October 2021 at 15:35:59 UTC+1 postt...@gmail.com wrote:

> Hello Brian,
> Metric: argo_workflows_custom_start_time_gauge_workflow
>
> Labels:
> timeStamp: 2021-10-11T08:48:11Z
> instanceName: ddd.vitam.wf.s.ldb.part-9tmq5
> service: argo-proxy-svc
> workflowName: vitam.wf.s.ldb.part
> namespace: itam-d-app-main
> prometheus: openshift-user-workload-monitoring/user-workload
> status: Succeeded
>
> this is the timestamp generated for the above custom metric:
> value: 20211011084811
>
> Hope it will help.
>
> Regards,
> Dhanunjaya Mitta
> On Wednesday, October 13, 2021 at 3:38:34 PM UTC+2 Brian Candler wrote:
>
>> There's no timestamp in that metric, so it's not possible to answer the 
>> question you wanted, which was "show the jobs which terminated in the last 
>> hour". All the metric tells you is that the job took 67 seconds - not when 
>> it started or ended.
>>
>> If there's a separate metric with the job start or end time, then it may 
>> be doable.
>>
>> On Wednesday, 13 October 2021 at 10:44:49 UTC+1 postt...@gmail.com wrote:
>>
>>>
>>> argo_workflows_custom_duration_gauge_task{status!="Pending"}
>>>
>>> These are the labels:
>>> instanceName: vitam.wf.b.business-layer-master-b4vqj
>>> service: argo-proxy-svc
>>> workflow_name: vitam.wf.b.business-layer-master
>>> namespace: itam-d-app-main
>>> pod: argo-proxy-deploy-5f87dfb6d4-pg4qh
>>> Prometheus: openshift-user-workload-monitoring/user-workload
>>> status: Failed
>>>
>>> This is the value: 67  
>>>
>>>
>>>
>>> On Wednesday, October 13, 2021 at 11:24:53 AM UTC+2 Brian Candler wrote:
>>>
>>>> If you won't show actual examples of the metrics, then I'm unable to 
>>>> help you form queries on those metrics.
>>>>
>>>> Metrics look like this:
>>>> metric_name{labels} value
>>>>
>>>> Here are some examples of metrics:
>>>> node_uname_info{job="node",instance="nuc1",domainname="(none)",machine="x86_64",nodename="nuc1",release="5.4.0-80-generic",sysname="Linux",version="#90~18.04.1-Ubuntu
>>>>  
>>>> SMP Tue Jul 13 19:40:02 UTC 2021"} 1
>>>> process_start_time_seconds{job="node",instance="nuc1"} 1.6283250991e+09
>>>>
>>>> Show the metrics in that form, and I may be able to help.
>>>>
>>>> On Wednesday, 13 October 2021 at 09:22:57 UTC+1 postt...@gmail.com 
>>>> wrote:
>>>>
>>>>> Hello Brian,
>>>>> Thanks for your quick reply. Your solution partially satisfied my 
>>>>> requirement. What if i would like to get the workflows which are 
>>>>> succeeded 
>>>>> in the last one hour. (Not the count, but also the name of the workflow). 
>>>>> argo_workflows_custom_duration_gauge_task is the custom metrics and 
>>>>> will give us the status and duration it ran for each workflow. I would 
>>>>> like 
>>>>> to know which workflows got succeeded in the past one hour.
>>>>>
>>>>> Regards,
>>>>> Dhanunjaya Mitta
>>>>> On Wednesday, October 13, 2021 at 10:07:36 AM UTC+2 Brian Candler 
>>>>> wrote:
>>>>>
>>>>>> You said your metrics are counter values.  If you want to know how 
>>>>>> much a counter has increased over the preceding hour, you can use
>>>>>>
>>>>>> increase(argo_workflows_count[1h])
>>>>>> or:
>>>>>> argo_worklows_count - argo_workflows_count offset 1h
>>>>>>
>>>>>> The first takes account of possible counter resets, but may give a 
>>>>>> value which is not exactly an integer.  It's a rate extrapolated over 
>>>>>> the 
>>>>>> period, so if you only have 10 minutes of data, it will work out the 
>>>>>> rate 
>>>>>> of increase over that time and then multiply by 60/T where T is the time 
>>>>>> difference between the first and last data point (roughly).
>>>>>>
>>>>>> The second will give an exact value for how much the counter has 
>>>>>> changed, but may go negative if the counter resets, and will give no 
>>>>>> answer 
>>>>>> if there was no value an hour ago.
>>>>>>
>>>>>

-- 
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/7eaf8be6-695e-48c3-a4b1-777393aab246n%40googlegroups.com.

Reply via email to