Hello. In Signoz, I checked the Time Series graph by querying with Query Builder as shown in the pho...
u
Hello. In Signoz, I checked the Time Series graph by querying with Query Builder as shown in the photo below.
Copy code
{
  "start": 1723526536000,
  "end": 1723528336000,
  "step": 60,
  "variables": {},
  "compositeQuery": {
    "queryType": "builder",
    "panelType": "graph",
    "builderQueries": {
      "A": {
        "dataSource": "metrics",
        "queryName": "A",
        "aggregateOperator": "increase",
        "aggregateAttribute": {
          "dataType": "float64",
          "id": "jvm_class_unloaded--float64--Sum--true",
          "isColumn": true,
          "isJSON": false,
          "key": "jvm_class_unloaded",
          "type": "Sum"
        },
        "timeAggregation": "increase",
        "spaceAggregation": "sum",
        "functions": [],
        "filters": {
          "items": [
            {
              "id": "df3b6963",
              "key": {
                "dataType": "string",
                "id": "service_name--string--tag--false",
                "isColumn": false,
                "isJSON": false,
                "key": "service_name",
                "type": "tag"
              },
              "op": "=",
              "value": "test"
            }
          ],
          "op": "AND"
        },
        "expression": "A",
        "disabled": false,
        "having": [],
        "stepInterval": 60,
        "limit": null,
        "orderBy": [],
        "groupBy": [],
        "legend": "",
        "reduceTo": "avg"
      }
    }
  }
}
However, I converted it to
Copy code
sum(increase(jvm_class_unloaded{service_name="test"}[1m]))
using PromQL, but no data is displayed. Is my PromQL syntax wrong? Isn't the time range 1m? If I enter 1m in PromQL, there is no data, and after 2m, a value appears, but it is even different from the Query Builder value. --- I have additional questions. Why is the result value displayed randomly when querying metrics from Signoz to PromQL? It is constant when querying with Query Builder.
Copy code
sum by(device, mountpoint, state, type, mode) (avg_over_time(system_filesystem_usage{operator_tag="test"}[1m]))
s
Isn't the time range 1m?
For PromQL to work, the interval should be at least twice as much as scape interval.
but it is even different from the Query Builder value.
What is the difference?
Why is the result value displayed randomly when querying metrics from Signoz to PromQL? It is constant when querying with Query Builder.
``````
Your question is not clear
u
Okay. Let me explain again exactly the differences. And I made some modifications to promql. Q1) # Query Builder (payload: first photo / graph result: second photo)
Copy code
- Duration: 30m
- Datasource: Metric
- aggregateAttribute key: jvm_class_loaded
- spaceAggregation: sum
- timeAggregation: increase
JSON Payload
Copy code
{
  "start": 1724031583000,
  "end": 1724033383000,
  "step": 60,
  "variables": {},
  "compositeQuery": {
    "queryType": "builder",
    "panelType": "graph",
    "builderQueries": {
      "A": {
        "dataSource": "metrics",
        "queryName": "A",
        "aggregateOperator": "increase",
        "aggregateAttribute": {
          "key": "jvm_class_loaded",
          "dataType": "float64",
          "type": "Sum",
          "isColumn": true,
          "isJSON": false,
          "id": "jvm_class_loaded--float64--Sum--true"
        },
        "timeAggregation": "increase",
        "spaceAggregation": "sum",
        "functions": [],
        "filters": {
          "items": [
            {
              "id": "0ecf344d",
              "key": {
                "dataType": "string",
                "id": "service_name--string--tag--false",
                "isColumn": false,
                "isJSON": false,
                "key": "service_name",
                "type": "tag"
              },
              "op": "=",
              "value": "XXXXXX"
            }
          ],
          "op": "AND"
        },
        "expression": "A",
        "disabled": false,
        "having": [],
        "stepInterval": 60,
        "limit": null,
        "orderBy": [],
        "groupBy": [
          {
            "key": "service_name",
            "dataType": "string",
            "type": "tag",
            "isColumn": false,
            "isJSON": false,
            "id": "service_name--string--tag--false"
          }
        ],
        "legend": "Loaded",
        "reduceTo": "avg"
      }
    }
  }
}
# PromQL (graph result: third photo)
Copy code
avg(sum by(service_name) (increase(jvm_class_loaded{service_name="XXXXXX"}[30m])))
If you compare the second and third photos, the graph values ​​are different. Is the promql I wrote wrong?
s
[30m]
Why are you doing this? What it means is an increase in the value from 30 minutes back.
Do not confuse step interval with the duration. The step interval should minimum be 2x of reporting interval for promql
u
The increase function does not use an interval variable, but requires specifying a specific period, so I obtained the increase value for the last 30 minutes. So.. how should I change promql? I'm confused. Help me plz🥲
s
Change [30m] to [2m] and check again
u
Even though I changed it to 2m, the value is different.🫠
s
What does it show?
u
1st photo: Query Builder / 2nd photo: PromQL
s
Why do you have "avg"
u
There was avg reduce to in the payload sent to query builder, so I applied it to promql as well. However, even if avg is omitted, the value is different from Query Builder.
s
Please share three things, query builder values, promql values (with avg removed) and raw promql values for metric
jvm_class_loaded
u
Okay. I wrote down the value based on the Signoz web standard. • Query Builder
Copy code
- Metrics / jvm_class_loaded / increase
- WHERE: service_name = test
- Sum By: service_name
- Legend Format: Loaded
- interval: 1m
• PromQL
Copy code
- PromQL Query: sum by(service_name) (increase(jvm_class_loaded{service_name="test"}[2m]))
- Legend Format: Loaded
s
I was asking for the response values.
u
Ah, okay. I wrote down the responses below. • Query Builder
Copy code
{
  "status": "success",
  "data": {
    "resultType": "",
    "result": [
      {
        "queryName": "A",
        "series": [
          {
            "labels": {
              "service_name": "Galaxy_store_prd"
            },
            "labelsArray": [
              {
                "service_name": "Galaxy_store_prd"
              }
            ],
            "values": [
              {
                "timestamp": 1724049180000,
                "value": "0"
              },
              {
                "timestamp": 1724049240000,
                "value": "0"
              },
              {
                "timestamp": 1724049300000,
                "value": "0"
              },
              {
                "timestamp": 1724049360000,
                "value": "0"
              },
              {
                "timestamp": 1724049420000,
                "value": "0"
              },
              {
                "timestamp": 1724049480000,
                "value": "0"
              },
              {
                "timestamp": 1724049540000,
                "value": "2"
              },
              {
                "timestamp": 1724049600000,
                "value": "2"
              },
              {
                "timestamp": 1724049660000,
                "value": "0"
              },
              {
                "timestamp": 1724049720000,
                "value": "2"
              },
              {
                "timestamp": 1724049780000,
                "value": "0"
              },
              {
                "timestamp": 1724049840000,
                "value": "2"
              },
              {
                "timestamp": 1724049900000,
                "value": "0"
              },
              {
                "timestamp": 1724049960000,
                "value": "2"
              },
              {
                "timestamp": 1724050020000,
                "value": "2"
              },
              {
                "timestamp": 1724050080000,
                "value": "0"
              },
              {
                "timestamp": 1724050140000,
                "value": "0"
              },
              {
                "timestamp": 1724050200000,
                "value": "0"
              },
              {
                "timestamp": 1724050260000,
                "value": "0"
              },
              {
                "timestamp": 1724050320000,
                "value": "0"
              },
              {
                "timestamp": 1724050380000,
                "value": "0"
              },
              {
                "timestamp": 1724050440000,
                "value": "0"
              },
              {
                "timestamp": 1724050500000,
                "value": "0"
              },
              {
                "timestamp": 1724050560000,
                "value": "0"
              },
              {
                "timestamp": 1724050620000,
                "value": "0"
              },
              {
                "timestamp": 1724050680000,
                "value": "0"
              },
              {
                "timestamp": 1724050740000,
                "value": "0"
              },
              {
                "timestamp": 1724050800000,
                "value": "6"
              },
              {
                "timestamp": 1724050860000,
                "value": "3"
              },
              {
                "timestamp": 1724050980000,
                "value": "3"
              },
              {
                "timestamp": 1724051040000,
                "value": "6"
              },
              {
                "timestamp": 1724051100000,
                "value": "3"
              },
              {
                "timestamp": 1724051160000,
                "value": "3"
              },
              {
                "timestamp": 1724051220000,
                "value": "6"
              },
              {
                "timestamp": 1724051280000,
                "value": "0"
              },
              {
                "timestamp": 1724051340000,
                "value": "4"
              },
              {
                "timestamp": 1724051400000,
                "value": "1"
              },
              {
                "timestamp": 1724051460000,
                "value": "4"
              },
              {
                "timestamp": 1724051520000,
                "value": "0"
              },
              {
                "timestamp": 1724051580000,
                "value": "1"
              },
              {
                "timestamp": 1724051640000,
                "value": "0"
              },
              {
                "timestamp": 1724051700000,
                "value": "4"
              },
              {
                "timestamp": 1724051760000,
                "value": "1"
              },
              {
                "timestamp": 1724051820000,
                "value": "0"
              },
              {
                "timestamp": 1724051880000,
                "value": "4"
              },
              {
                "timestamp": 1724051940000,
                "value": "0"
              },
              {
                "timestamp": 1724052000000,
                "value": "0"
              },
              {
                "timestamp": 1724052060000,
                "value": "0"
              },
              {
                "timestamp": 1724052120000,
                "value": "0"
              },
              {
                "timestamp": 1724052180000,
                "value": "0"
              },
              {
                "timestamp": 1724052240000,
                "value": "0"
              },
              {
                "timestamp": 1724052300000,
                "value": "0"
              },
              {
                "timestamp": 1724052360000,
                "value": "0"
              },
              {
                "timestamp": 1724052420000,
                "value": "0"
              },
              {
                "timestamp": 1724052480000,
                "value": "0"
              },
              {
                "timestamp": 1724052540000,
                "value": "0"
              },
              {
                "timestamp": 1724052600000,
                "value": "0"
              },
              {
                "timestamp": 1724052660000,
                "value": "0"
              },
              {
                "timestamp": 1724052720000,
                "value": "0"
              },
              {
                "timestamp": 1724052780000,
                "value": "0"
              },
              {
                "timestamp": 1724052840000,
                "value": "0"
              },
              {
                "timestamp": 1724052900000,
                "value": "0"
              },
              {
                "timestamp": 1724052960000,
                "value": "0"
              },
              {
                "timestamp": 1724053020000,
                "value": "0"
              },
              {
                "timestamp": 1724053080000,
                "value": "0"
              },
              {
                "timestamp": 1724053140000,
                "value": "0"
              },
              {
                "timestamp": 1724053200000,
                "value": "1"
              },
              {
                "timestamp": 1724053260000,
                "value": "0"
              },
              {
                "timestamp": 1724053320000,
                "value": "0"
              },
              {
                "timestamp": 1724053380000,
                "value": "0"
              },
              {
                "timestamp": 1724053440000,
                "value": "0"
              },
              {
                "timestamp": 1724053500000,
                "value": "0"
              },
              {
                "timestamp": 1724053560000,
                "value": "0"
              },
              {
                "timestamp": 1724053620000,
                "value": "0"
              },
              {
                "timestamp": 1724053680000,
                "value": "0"
              },
              {
                "timestamp": 1724053740000,
                "value": "0"
              }
            ]
          }
        ],
        "list": null
      }
    ]
  }
}
• PromQL 1. increase time value [2m]
Copy code
{
  "status": "success",
  "data": {
    "resultType": "",
    "result": [
      {
        "queryName": "A",
        "series": [
          {
            "labels": {
              "service_name": "Galaxy_store_prd"
            },
            "labelsArray": null,
            "values": [
              {
                "timestamp": 1724049457000,
                "value": "0"
              },
              {
                "timestamp": 1724049517000,
                "value": "0"
              },
              {
                "timestamp": 1724049577000,
                "value": "0"
              },
              {
                "timestamp": 1724049757000,
                "value": "0"
              },
              {
                "timestamp": 1724050357000,
                "value": "0"
              },
              {
                "timestamp": 1724050417000,
                "value": "0"
              },
              {
                "timestamp": 1724050477000,
                "value": "0"
              },
              {
                "timestamp": 1724050597000,
                "value": "0"
              },
              {
                "timestamp": 1724050717000,
                "value": "0"
              },
              {
                "timestamp": 1724050777000,
                "value": "0"
              },
              {
                "timestamp": 1724050837000,
                "value": "0"
              },
              {
                "timestamp": 1724050957000,
                "value": "0"
              },
              {
                "timestamp": 1724051017000,
                "value": "0"
              },
              {
                "timestamp": 1724051197000,
                "value": "0"
              },
              {
                "timestamp": 1724051497000,
                "value": "0"
              },
              {
                "timestamp": 1724051917000,
                "value": "0"
              },
              {
                "timestamp": 1724052157000,
                "value": "0"
              },
              {
                "timestamp": 1724052457000,
                "value": "0"
              },
              {
                "timestamp": 1724052517000,
                "value": "0"
              },
              {
                "timestamp": 1724052577000,
                "value": "0"
              },
              {
                "timestamp": 1724052937000,
                "value": "0"
              },
              {
                "timestamp": 1724053237000,
                "value": "0"
              },
              {
                "timestamp": 1724053297000,
                "value": "0"
              },
              {
                "timestamp": 1724053357000,
                "value": "0"
              },
              {
                "timestamp": 1724053717000,
                "value": "0"
              },
              {
                "timestamp": 1724053837000,
                "value": "0"
              },
              {
                "timestamp": 1724053837001,
                "value": "0"
              }
            ]
          }
        ],
        "list": null
      }
    ]
  }
}
2. increase time value [5m]
Copy code
{
  "status": "success",
  "data": {
    "resultType": "",
    "result": [
      {
        "queryName": "A",
        "series": [
          {
            "labels": {
              "service_name": "Galaxy_store_prd"
            },
            "labelsArray": null,
            "values": [
              {
                "timestamp": 1724049037000,
                "value": "0"
              },
              {
                "timestamp": 1724049097000,
                "value": "0"
              },
              {
                "timestamp": 1724049157000,
                "value": "0"
              },
              {
                "timestamp": 1724049217000,
                "value": "0"
              },
              {
                "timestamp": 1724049277000,
                "value": "0"
              },
              {
                "timestamp": 1724049337000,
                "value": "0"
              },
              {
                "timestamp": 1724049397000,
                "value": "0"
              },
              {
                "timestamp": 1724049457000,
                "value": "0"
              },
              {
                "timestamp": 1724049517000,
                "value": "0"
              },
              {
                "timestamp": 1724049577000,
                "value": "0"
              },
              {
                "timestamp": 1724049637000,
                "value": "5"
              },
              {
                "timestamp": 1724049697000,
                "value": "7.5"
              },
              {
                "timestamp": 1724049757000,
                "value": "3.1376333333333335"
              },
              {
                "timestamp": 1724049817000,
                "value": "2.5"
              },
              {
                "timestamp": 1724049877000,
                "value": "0"
              },
              {
                "timestamp": 1724049937000,
                "value": "0"
              },
              {
                "timestamp": 1724049997000,
                "value": "0"
              },
              {
                "timestamp": 1724050057000,
                "value": "0"
              },
              {
                "timestamp": 1724050117000,
                "value": "0"
              },
              {
                "timestamp": 1724050177000,
                "value": "0"
              },
              {
                "timestamp": 1724050237000,
                "value": "0"
              },
              {
                "timestamp": 1724050297000,
                "value": "0"
              },
              {
                "timestamp": 1724050357000,
                "value": "0"
              },
              {
                "timestamp": 1724050417000,
                "value": "0"
              },
              {
                "timestamp": 1724050477000,
                "value": "0"
              },
              {
                "timestamp": 1724050537000,
                "value": "0"
              },
              {
                "timestamp": 1724050597000,
                "value": "0"
              },
              {
                "timestamp": 1724050657000,
                "value": "0"
              },
              {
                "timestamp": 1724050717000,
                "value": "0"
              },
              {
                "timestamp": 1724050777000,
                "value": "0"
              },
              {
                "timestamp": 1724050837000,
                "value": "0"
              },
              {
                "timestamp": 1724050897000,
                "value": "0"
              },
              {
                "timestamp": 1724050957000,
                "value": "0"
              },
              {
                "timestamp": 1724051017000,
                "value": "0"
              },
              {
                "timestamp": 1724051077000,
                "value": "3.749984375065104"
              },
              {
                "timestamp": 1724051137000,
                "value": "0"
              },
              {
                "timestamp": 1724051197000,
                "value": "0"
              },
              {
                "timestamp": 1724051257000,
                "value": "0"
              },
              {
                "timestamp": 1724051317000,
                "value": "0"
              },
              {
                "timestamp": 1724051377000,
                "value": "0"
              },
              {
                "timestamp": 1724051437000,
                "value": "1.25"
              },
              {
                "timestamp": 1724051497000,
                "value": "0"
              },
              {
                "timestamp": 1724051557000,
                "value": "0"
              },
              {
                "timestamp": 1724051617000,
                "value": "0"
              },
              {
                "timestamp": 1724051677000,
                "value": "0"
              },
              {
                "timestamp": 1724051737000,
                "value": "0"
              },
              {
                "timestamp": 1724051797000,
                "value": "0"
              },
              {
                "timestamp": 1724051857000,
                "value": "0"
              },
              {
                "timestamp": 1724051917000,
                "value": "0"
              },
              {
                "timestamp": 1724051977000,
                "value": "0"
              },
              {
                "timestamp": 1724052037000,
                "value": "0"
              },
              {
                "timestamp": 1724052097000,
                "value": "0"
              },
              {
                "timestamp": 1724052157000,
                "value": "0"
              },
              {
                "timestamp": 1724052217000,
                "value": "0"
              },
              {
                "timestamp": 1724052277000,
                "value": "0"
              },
              {
                "timestamp": 1724052337000,
                "value": "0"
              },
              {
                "timestamp": 1724052397000,
                "value": "0"
              },
              {
                "timestamp": 1724052457000,
                "value": "0"
              },
              {
                "timestamp": 1724052517000,
                "value": "0"
              },
              {
                "timestamp": 1724052577000,
                "value": "0"
              },
              {
                "timestamp": 1724052637000,
                "value": "0"
              },
              {
                "timestamp": 1724052697000,
                "value": "0"
              },
              {
                "timestamp": 1724052757000,
                "value": "0"
              },
              {
                "timestamp": 1724052817000,
                "value": "0"
              },
              {
                "timestamp": 1724052877000,
                "value": "0"
              },
              {
                "timestamp": 1724052937000,
                "value": "0"
              },
              {
                "timestamp": 1724052997000,
                "value": "0"
              },
              {
                "timestamp": 1724053057000,
                "value": "0"
              },
              {
                "timestamp": 1724053117000,
                "value": "0"
              },
              {
                "timestamp": 1724053177000,
                "value": "0"
              },
              {
                "timestamp": 1724053237000,
                "value": "0"
              },
              {
                "timestamp": 1724053297000,
                "value": "0"
              },
              {
                "timestamp": 1724053357000,
                "value": "0"
              },
              {
                "timestamp": 1724053417000,
                "value": "0"
              },
              {
                "timestamp": 1724053477000,
                "value": "0"
              },
              {
                "timestamp": 1724053537000,
                "value": "0"
              },
              {
                "timestamp": 1724053597000,
                "value": "0"
              },
              {
                "timestamp": 1724053657000,
                "value": "0"
              },
              {
                "timestamp": 1724053717000,
                "value": "0"
              },
              {
                "timestamp": 1724053777000,
                "value": "0"
              },
              {
                "timestamp": 1724053837000,
                "value": "0"
              }
            ]
          }
        ],
        "list": null
      }
    ]
  }
}
1st photo: Query Builder 2nd photo: [2m] 3rd photo: [5m]