Thank you, Matthias. Please see my comments below.

On Monday, November 16, 2020, Matthias Rampke <[email protected]>
wrote:

> 1. Now
>
I would like to understand the definition of ‘Now’. Is it more recent one
with a certain timeframe? If so what timeframe?

> 2. Uh, not sure, probably better to specify one 😬
> 3. Probably not, end might default to "now" implicitly?
> 4. They are different – there are two different types involved here.
> `http_request_total` returns an instant vector: a 1-dimensional list of
> the value at that instance for each label combination.
> `http_request_total[1m]` is a matrix: for each label combination, it has a
> list of values going back 1 minute with some automatic step IIRC. Normally
> you don't handle these directly; they are used e.g. by rate() to calculate
> the rate of counters over this period.
>

So is giving duration sane as range query with start time, end time and
step?


> 5. It us returning this matrix.
>
> The query_range API is an optimized way to make many "instant" requests at
> once. You can get logically the same results by calling the query API many
> times with different time stamps. For each instant, the response can be of
> different types, although in most common queries they will be of the
> "instant vector" type because that is what you can build a graph from.
>
> /MR
>
>
> On Mon, Nov 16, 2020, 04:42 kiran <[email protected]> wrote:
>
>> Hello all,
>>
>> I am new to PromQL and would like to understand as I could not find
>> things (unless I am missing it) here:
>> https://prometheus.io/docs/prometheus/latest/querying/api/
>>
>> 1. For an instant query, if I dont give timestamp, then what is the
>> logic/default timestamp.
>> 2. For range query, what is the default step value if no value is
>> provided?
>> 3. For range query, are start, and end parameters optional?
>> 4. I see that time duration can be given after the metric in square
>> brackets (e.g http_requests_total[5m]). Is giving time duration this way
>> the same as giving range query with equivalent unix timestamp values for
>> start and end parameters?
>>
>> So I am trying to understand if both the queries below are same and yield
>> same result(including result format):
>>
>> /api/v1/query_range?query=<metricname>[<duration>]
>> /api/v1/query_range?query=<metricname>&start=<strartunixtimestamp>&end=<
>> endunixtimestamp>
>>
>> 5. I see that giving duration in square brackets is working for instant
>> query as well(e.g /api/v1/query?query=<metricname>[<duration>]), but not
>> sure what timeseries it is retrieving. Any valid cases to use this way?
>>
>>
>> --
>> 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/CAOnWYZVk%3D-MRzawQ_BHamf_vtS-
>> 7960uM5kigO%3DtE559RaGoEw%40mail.gmail.com
>> <https://groups.google.com/d/msgid/prometheus-users/CAOnWYZVk%3D-MRzawQ_BHamf_vtS-7960uM5kigO%3DtE559RaGoEw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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/CAOnWYZW%2B-a77Dp%2Bv8vrawj0w6pTBPcq7MOB6Wh8nX04Ecjginw%40mail.gmail.com.

Reply via email to