bsport-exporter

command module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 20, 2022 License: MIT Imports: 9 Imported by: 0

README

bsport-exporter

An exporter for bsport.

It is currently very basic and is supposed to be use to track how many bookings have been made in total:

➜  ~ curl -s localhost:6677/metrics | grep bsport
# HELP bsport_bookings_count Number of bookings
# TYPE bsport_bookings_count gauge
bsport_bookings_count 117

It uses the total number of bookings returned by the bsport API and does not parse the bookings themselves. Thus, the canceled bookings are also counted.

The gauge is updated every hour.

Installation

Grab the latest binary from the releases, or build it yourself!

Usage

➜ ./bsport-exporter -help
Usage of ./bsport-exporter:
  -member string
        BSport member ID
  -token string
        BSport API token

Go on backoffice.bsport.io and inspect the network requests.

You can extract your member ID from the query string of some requests and your token from the authorization header of any request.

Then, launch the exporter:

bsport-exporter -member xxxxxx -token xxxxxx

You should see something like:

INFO[0000] Beginning to serve on 0.0.0.0:6677
INFO[0000] Updated gauge                                 bookings=118

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL