That is correct. The metric being returned is not E001_C04_kW; it is a
calculated value. In this case it is derived from a single metric E001_C04_kW,
but in general could be derived from multiple metrics.
You'll see the same in the PromQL browser. For example, if you give this
query:
up
then each metric returned is of the form up{...labels...}. But if you give
this query:
up * 2
then each metric returned is of the form {...labels...} (i.e. there is no
metric name, because this is no longer the "up" metric but a calculated
value).
On Tuesday, 9 November 2021 at 19:40:11 UTC [email protected] wrote:
> Thanks Brian,
> I realy make one request per call,
> My problem now is,
>
> For this request
>
> query=a100_001_FT_DACA_PV
>
> Json return this
> {
> "status": "success",
> "data": {
> "resultType": "vector",
> "result": [
> {
> "metric": {
> *"__name__": "a100_001_FT_DACA_PV",*
> "instance": "172.115.0.25:4242",
> "job": "prometheus"
> },
> "value": [
> 1636486652.982,
> "597.5383929357245"
> ]
> }
> ]
> }
> }
>
> An for this query:
> query= avg_over_time(E001_C04_kW[1h])
> This ...
> {
> "status": "success",
> "data": {
> "resultType": "vector",
> "result": [
> {
> "metric": {
> "instance": "172.115.0.20:5001",
> "job": "prometheus"
> },
> "value": [
> 1636486694.982,
> "23354.967702907958"
> ]
> }
> ]
> }
> }
>
> Note output of query= avg_over_time(E001_C04_kW[1h]) a key * __name__*
> doenst return, how to force this query returning key *__name__ *in result
> ?
>
> Best Regards
> Em terça-feira, 9 de novembro de 2021 às 16:11:34 UTC-3, Brian Candler
> escreveu:
>
>> As far as I know, the HTTP API only supports one request per call.
>>
>> In fact, really you have three queries, so you should be making three
>> HTTP requests:
>>
>> query=a100_001_FT_DACA_PV
>> query=a101_401_0_PIC_PIDA_PV
>> query=avg_over_time(E002_C04_kW[1h])/1000
>>
>
--
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/22b763ec-52ec-434d-adc9-d25ce7c82b44n%40googlegroups.com.