Skip to content

uwsgi-stats-address error handling #1

@xrmx

Description

@xrmx

I'm trying uwsgi_exporter and prometheus for the first time and i've done some newbie mistakes.

If I type a non existent path:

./uwsgi_exporter -uwsgi-stats-address unix://var/log/missing-slash-before-var.sock

I don't get any error but i get the single metric in prometheus signaling there's something wrong. Possibly we can gave error out on the uwsgi_export side.

Then if i miss the protocol from the uri it panics but instead we can handle that a bit more gracefully:

./uwsgi_exporter -uwsgi-stats-address /var/log/uwsgi/production.sock 
panic: runtime error: index out of range

goroutine 1 [running]:
panic(0x6c36e0, 0xc4200120e0)
	/usr/lib/go-1.7/src/runtime/panic.go:500 +0x1a1
main.parse_uwsgi_stats_addr(0x7ffcbc27777a, 0x1e, 0x0, 0x725f53, 0x26, 0xc420013b70, 0x0, 0x0)
	/home/rm/src/uwsgi_exporter/main.go:19 +0x3f4
main.main()
	/home/rm/src/uwsgi_exporter/main.go:46 +0x45

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions