Yeah. POST preserving metrics from an old run can be useful for example
when you have a batch job that pushes certain metrics only on success, but
still pushes a subset of metrics when it does not succeed. For example, it
might always push "my_batch_job_last_run_timestamp_seconds" to tell you the
last time it ran, but only push
"my_batch_job_last_success_timestamp_seconds" when it actually succeeded.
By using POST, you can keep the success timestamp metric from the old run
by not sending that metric at all, but only the last run timestamp.

On Fri, Jun 26, 2020 at 6:19 PM Mat Arye <[email protected]> wrote:

> So from my understanding, given a grouping key specified in the url and a
> metric m1 that exists in the data with the grouping key but /is not/ in the
> payload. Under put, that metric would be deleted since put overrides all
> the data for the grouping key. Push on the other hand will leave m1 alone,
> thats whats meant be "but only metrics with the same name as the newly
> pushed metrics are replaced"
>
> Another way to see this clearly is this line from the docs "A PUT request
> with an empty body effectively deletes all metrics with the specified
> grouping key."
>
> On Fri, Jun 26, 2020 at 6:57 AM Roman Ratsun <[email protected]>
> wrote:
>
>> https://github.com/prometheus/pushgateway#post-method
>> POST works exactly like the PUT method but only metrics with the same
>> name as the newly pushed metrics are replaced (among those with the same
>> grouping key).
>>
>> I don't understand this definition. When I send request by post method
>> the metrics are replaced and when I send request by put the metric are
>> replaced. *What is the difference?* And ofcourse I send post and put
>> with the same grouping key.
>>
>> --
>> 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/88e7aded-2e24-4fb2-9f2f-e8ba624f4ba4o%40googlegroups.com
>> <https://groups.google.com/d/msgid/prometheus-users/88e7aded-2e24-4fb2-9f2f-e8ba624f4ba4o%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>
>
> --
> Mat Arye, Timescale-Prometheus
> <https://github.com/timescale/timescale-prometheus> Team Lead
> See what we're working on (feedback welcome!): tsdb.co/prom-design-doc
>
> --
> 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/CADsUR0DCKHCiCJ79HiOAzPn0yPCP7T1yjD1QMHx%3D0eTic%2Bvo6A%40mail.gmail.com
> <https://groups.google.com/d/msgid/prometheus-users/CADsUR0DCKHCiCJ79HiOAzPn0yPCP7T1yjD1QMHx%3D0eTic%2Bvo6A%40mail.gmail.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/CAObpH5wivQTRvRORV3E02_ZRLjxNUw67n_ZrhysMrH0GQxxjkg%40mail.gmail.com.

Reply via email to