typesense-prometheus-exporter icon indicating copy to clipboard operation
typesense-prometheus-exporter copied to clipboard

Hm, the response didn't match the shape we expected. Hm, the response didn't match the shape we expected.

Open teenwolf99 opened this issue 1 year ago • 4 comments

Hi @imatefx,

Build from the source v0.1.4 using cargo and tried running the program.

Successfully connected to Prometheus and received Typesense data from /metrics.

But not able to get the data from /stats, Its throwing these kind of errors. Please enlighten the meaning of this error message.

Hm, the response didn't match the shape we expected.

Hm, the response didn't match the shape we expected.

Hm, the response didn't match the shape we expected.

Hm, the response didn't match the shape we expected

Same message thrown again and again.

Able to get data from Typesence directly using the curl localhost/stats.json

teenwolf99 avatar Jun 24 '24 06:06 teenwolf99

Hi @teenwolf99 , Can you try using the docker image? Which version of typesense are you using?

imatefx avatar Jun 24 '24 07:06 imatefx

Ok, will try the docker image.

Typesense-server-0.23.1 OS - ubuntu 22.04

teenwolf99 avatar Jun 24 '24 07:06 teenwolf99

@imatefx tried the Docker Container too, still no luck in getting the error sorted.

CONTAINER ID IMAGE COMMAND CREATED STATUS
4243f5f7b7a2 imatefx/typesense-prometheus-exporter "./typesense-prometh…" 3 minutes ago Up 3 minutes

docker logs -f 4243f5f7b7a2

Starting exporter server at "0.0.0.0:7070" Hm, the response didn't match the shape we expected. Hm, the response didn't match the shape we expected. Hm, the response didn't match the shape we expected. Hm, the response didn't match the shape we expected. Hm, the response didn't match the shape we expected.

teenwolf99 avatar Jun 24 '24 08:06 teenwolf99

Hey, I have the same issue. I am running this under NixOS with my own packaging.

Jul 14 19:37:55 vps typesense-exporter[1305]: Hm, the response didn't match the shape we expected. reqwest::Error { kind: Decode, source: Error("missing field `system_cpu1_active_percentage`", line: 17, column: 1) }
Jul 14 19:38:25 vps typesense-exporter[1305]: Hm, the response didn't match the shape we expected. reqwest::Error { kind: Decode, source: Error("missing field `system_cpu1_active_percentage`", line: 17, column: 1) }

When querying the API I don't get any stats about the CPU percentage, maybe wrapping it in an Option should solve the issue?

root@vps:/ > curl -H 'X-TYPESENSE-API-KEY: <redacted>' 127.0.0.1:8108/metrics.json -i 
HTTP/1.1 200 OK
Connection: keep-alive
access-control-allow-origin: *
content-type: application/json; charset=utf-8
transfer-encoding: chunked

{
  "system_disk_total_bytes": "80049651712",
  "system_disk_used_bytes": "54374744064",
  "system_memory_total_bytes": "8131166208",
  "system_memory_total_swap_bytes": "4065325056",
  "system_memory_used_bytes": "0",
  "system_memory_used_swap_bytes": "0",
  "system_network_received_bytes": "0",
  "system_network_sent_bytes": "0",
  "typesense_memory_active_bytes": "67690496",
  "typesense_memory_allocated_bytes": "61318280",
  "typesense_memory_fragmentation_ratio": "0.09",
  "typesense_memory_mapped_bytes": "113856512",
  "typesense_memory_metadata_bytes": "12233088",
  "typesense_memory_resident_bytes": "67690496",
  "typesense_memory_retained_bytes": "46575616"
}#

weriomat avatar Jul 14 '25 17:07 weriomat