JAIME SEBASTIAN BURBANO VILLAVICENCIO
05/03/2024, 12:34 PMSrikanth Chekuri
05/04/2024, 3:19 AMSELECT JSONExtractString(labels, 'host_name') as host_name
FROM signoz_metrics.distributed_time_series_v4_1day
WHERE metric_name = 'system_load_average_1m' AND JSONExtractString(labels, 'deployment_environment') = {{.deployment_environment}} AND unix_milli >= toUnixTimestamp(now() - INTERVAL 1 DAY) * 1000
GROUP BY host_name;
JAIME SEBASTIAN BURBANO VILLAVICENCIO
05/06/2024, 8:41 AMSrikanth Chekuri
05/06/2024, 3:29 PMJAIME SEBASTIAN BURBANO VILLAVICENCIO
05/07/2024, 7:24 AMJAIME SEBASTIAN BURBANO VILLAVICENCIO
05/07/2024, 12:10 PMSELECT DISTINCT JSONExtractString(labels, 'host_name')
FROM signoz_metrics.time_series_v2
in the variable "host_name".
when replicating the query used in the json from the clickhouse client I got the following:
Received exception from server (version 24.1.2):
Code: 173. DB::Exception: Received from 127.0.0.1:9000. DB::Exception: Couldn't allocate 333 bytes when parsing JSON: while executing 'FUNCTION JSONExtractString(labels :: 0, 'host_name' :: 1) -> JSONExtractString(labels, 'host_name') String : 2'. (CANNOT_ALLOCATE_MEMORY)
Now, I have changed it to
SELECT DISTINCT(simpleJSONExtractRaw(labels, 'host_name'))
FROM signoz_metrics.time_series_v2.
I can finally see the name of my host (UEcollector) in the list on hostmetrics dashboard, but when selecting it, the dashboard is empty.
When I see the information of a panel that for example internally runs the query
sum by(host_name) (system_memory_usage{host_name="{{.hostname}}",state="used"}) / sum by(host_name) (system_memory_usage{host_name="{{.hostname}}"})
, it shows the error:
API responded with 400 - error in prom queries status: error, errors: {"A":"1:52: parse error: unexpected identifier \"UEcollector\" in label matching, expected \",\" or \"}\""}
When running the query
SELECT *
FROM signoz_metrics.time_series_v2
WHERE metric_name = 'system_memory_usage'
directly in clickhouse DB, it only returns 6 rows in the form:
│ system_memory_usage │ 17253326157141099054 │ 1715081635962 │ {"__name__":"system_memory_usage","__temporality__":"Cumulative","host_name":"UEcollector","os_type":"linux","state":"used"} │ Cumulative │ Bytes of memory in use. │ By │ Sum │ false │
Also I cannot see any value for the metric in the label section.
Could anyone provide some support?
Thanks in advanceSrikanth Chekuri
05/07/2024, 1:25 PMSELECT DISTINCT(simpleJSONExtractRaw(labels, 'host_name'))
FROM signoz_metrics.time_series_v2.
This is the reason for failure. Please use the original query and allocate some more memory to avoid.
Received exception from server (version 24.1.2):
Code: 173. DB::Exception: Received from 127.0.0.1:9000. DB::Exception: Couldn't allocate 333 bytes when parsing JSON: while executing 'FUNCTION JSONExtractString(labels :: 0, 'host_name' :: 1) -> JSONExtractString(labels, 'host_name') String : 2'. (CANNOT_ALLOCATE_MEMORY)
JAIME SEBASTIAN BURBANO VILLAVICENCIO
05/08/2024, 6:45 AMSrikanth Chekuri
05/08/2024, 8:46 AMhow can I allocate more memory to the clickhouse container or what do you mean?The error from ClickHouse says there is not enough memory. How much memory did you provision? Use the
simpleJSONExtractRaw
is the source of the issue.
Also, when querying directly the database, as mentioned, cannot really see new incoming rows about hostmetrics. If I'm monitoring each 30s, I assume a new query should appear in the DB after this time. or maybe I'm not understanding this properly.There might some errors in the collector logs or clickhouse. Please find and address them
JAIME SEBASTIAN BURBANO VILLAVICENCIO
05/08/2024, 9:54 AMservices:
clickhouse:
<<: *clickhouse-defaults
container_name: signoz-clickhouse
hostname: clickhouse
ports:
- "9000:9000"
- "8123:8123"
- "9181:9181"
volumes:
- ./clickhouse-config.xml:/etc/clickhouse-server/config.xml
- ./clickhouse-users.xml:/etc/clickhouse-server/users.xml
- ./custom-function.xml:/etc/clickhouse-server/custom-function.xml
- ./clickhouse-cluster.xml:/etc/clickhouse-server/config.d/cluster.xml
# - ./clickhouse-storage.xml:/etc/clickhouse-server/config.d/storage.xml
- ./data/clickhouse/:/var/lib/clickhouse/
- ./user_scripts:/var/lib/clickhouse/user_scripts/
mem_limit: 4g # Set memory limit to 4 GB
Also, could you please provide a detailed solution on how to access and see the errors in the collector logs or clickhouse?
Finally, according to my understanding, the query SELECT DISTINCT(simpleJSONExtractRaw(labels, 'host_name'))
FROM signoz_metrics.time_series_v2.
is only used to get the names of the host in the hostmetrics dashbord. Then if from one of the panels from the SigNoz Hostmetrics dashboard (lets use memory usage as an example), in the promQL Query, I manually replace the {{.hostname}}
variable by the name of my host (like below), I should get the data
# in a query such as:
sum by(host_name) (system_memory_usage{host_name="{{.hostname}}",state="used"}) / sum by(host_name) (system_memory_usage{host_name="{{.hostname}}"})
# i replace the variable with my host name, such as
sum by(host_name) (system_memory_usage{host_name="UEcollector",state="used"}) / sum by(host_name) (system_memory_usage{host_name="UEcollector"})
However, I don´t get any data. This leads me to think there is a different error rather with collecting the data or how I try to access to itSigNoz is an open-source APM. It helps developers monitor their applications & troubleshoot problems, an open-source alternative to DataDog, NewRelic, etc.
Powered by