prometheus-junkyard / mesos_exporter

Prometheus exporter for Mesos, deprecated.
Apache License 2.0
42 stars 22 forks source link

failed to deserialize response: json: cannot unmarshal object into Go value of type #14

Closed gfliker closed 9 years ago

gfliker commented 9 years ago

Getting this error when running the mesos_exporter

"failed to deserialize response: json: cannot unmarshal object into Go value of type []mesos_stats.Monitor file=main.go line=167"

The command line arguments are "mesos_exporter -exporter.interval 1m0s -exporter.local-url "http://localhost:5051/metrics/snapshot" -web.listen-address ":9105""

We've tried a couple of "-exporter.local-url" variations thats the only one that actually doing something.

juliusv commented 9 years ago

/cc @antonlindstrom @tommyulfsparre @wndhydrnt maybe one of you knows an obvious answer to this - again I suffer from not having had any exposure to Mesos yet :)

brian-brazil commented 9 years ago

Can you provide an example output from /metrics/snapshot?

antonlindstrom commented 9 years ago

Which version of Mesos are you running?

tommyulfsparre commented 9 years ago

@gfliker the mesos_exporter will only scrape ${local-url}/monitor/statistics.json so the argument should be: -exporter.local-url "http://localhost:5051".

Seems like mem_rss_bytes is change in 0.23.0 according to MESOS-2104

(It think scraping metrics/snapshot is being addressed in a PR.)

sciffer commented 9 years ago

Hi Guys, I'll be replacing Gil here The version is indeed 0.23.0 Here are the metrics/snapshot {"containerizer\/mesos\/container_destroy_errors":0,"slave\/container_launch_errors":0,"slave\/cpus_percent":0.00416666666666673,"slave\/cpus_revocable_percent":0,"slave\/cpus_revocable_total":0,"slave\/cpus_revocable_used":0,"slave\/cpus_total":24,"slave\/cpus_used":0.100000000000001,"slave\/disk_percent":0,"slave\/disk_revocable_percent":0,"slave\/disk_revocable_total":0,"slave\/disk_revocable_used":0,"slave\/disk_total":13973,"slave\/disk_used":0,"slave\/executor_directory_max_allowed_age_secs":470454.481752613,"slave\/executors_registering":0,"slave\/executors_running":0,"slave\/executors_terminated":1,"slave\/executors_terminating":0,"slave\/frameworks_active":1,"slave\/invalid_framework_messages":0,"slave\/invalid_status_updates":0,"slave\/mem_percent":0.00102926986169186,"slave\/mem_revocable_percent":0,"slave\/mem_revocable_total":0,"slave\/mem_revocable_used":0,"slave\/mem_total":31090,"slave\/mem_used":32,"slave\/recovery_errors":0,"slave\/registered":1,"slave\/tasks_failed":0,"slave\/tasks_finished":1,"slave\/tasks_killed":0,"slave\/tasks_lost":0,"slave\/tasks_running":0,"slave\/tasks_staging":0,"slave\/tasks_starting":0,"slave\/uptime_secs":704131.430808064,"slave\/valid_framework_messages":0,"slave\/valid_status_updates":2,"system\/cpus_total":24,"system\/load_15min":0.06,"system\/load_1min":0.01,"system\/load_5min":0.07,"system\/mem_free_bytes":25381126144,"system\/mem_total_bytes":33674858496}

We provide the URL that you mentioned above, just the http://host:port, we did not provide any path/uri with it.

tommyulfsparre commented 9 years ago

@ShalomCohen that's odd. I cant reproduce this on 0.23.0 by running ./mesos_exporter -exporter.interval=10s -exporter.local-url=http://127.0.0.1:5051 on the same instance that is running mesos-slave.

Fetching the metrics from the exporter returns the expected result:

curl http://127.0.0.1:9105/metrics
...
# HELP mesos_task_cpu_user_seconds_total Cumulative user CPU time in seconds.
# TYPE mesos_task_cpu_user_seconds_total counter
mesos_task_cpu_user_seconds_total{framework_id="20150831-222940-16842879-5050-4509-0000",slave="127.0.0.1",task="hello.95819d9d-5030-11e5-bc59-56847afe9799"} 3.26
...
sciffer commented 9 years ago

Well, I do see some metrics as well, but at the end I do see the parse failure message and in the logs the mentioned error message.

sciffer commented 9 years ago

Here is the exact message that we see in the output of the collector:

# HELP mesos_exporter_slave_scrape_errors_total Current total scrape errors
#  TYPE mesos_exporter_slave_scrape_errors_total counter
mesos_exporter_slave_scrape_errors_total{slave="localhost"} 93

All the other metrics are general collector metrics and not relevant to mesos itself.

tommyulfsparre commented 9 years ago

@ShalomCohen can you paste the output of: curl http://localhost:5051/monitor/statistics.json ? (assuming the mesos-slave process is running on the default port)

sciffer commented 9 years ago

I just found that the issue is that for whatever reason an old test overwritten the url path to the wrong path. I changed it to the regular path and everything started working immediately. In other words, it was not an issue with the code (something went wrong in our environment - our bad). Sorry and you can close the issue.

juliusv commented 9 years ago

Ha, can happen! Thanks everyone for helping out though!