https://github.com/moznion/prom2jsond
A HTTP daemon for prom2json
https://github.com/moznion/prom2jsond
json prometheus
Last synced: 2 months ago
JSON representation
A HTTP daemon for prom2json
- Host: GitHub
- URL: https://github.com/moznion/prom2jsond
- Owner: moznion
- License: apache-2.0
- Created: 2018-03-05T10:42:21.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-05T10:58:04.000Z (over 8 years ago)
- Last Synced: 2025-04-10T23:54:55.632Z (about 1 year ago)
- Topics: json, prometheus
- Language: Go
- Homepage: https://hub.docker.com/r/moznion/prom2jsond/
- Size: 6.84 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
prom2jsond
==
A HTTP daemon for [prom2json](https://github.com/prometheus/prom2json)
Usage
--
### Options
```
-accept-invalid-cert
Accept any certificate during TLS handshake. Insecure, use only for testing.
-cert string
certificate file
-key string
key file
-path string
path to expose (default "/")
-port int
port number to expose (default 80)
-prom2jsoncmd string
[MANDATORY] executable prom2json command
```
### Execute binary
```
$ prom2jsond --prom2jsoncmd=/path/to/prom2json --path=/stats --port=8080 https://app.example.com/target/stats
$ curl localhost:8080/stats # => output
```
### Execute with Docker
```
$ docker run -it -p 8080:8080 moznion/prom2jsond --path=/stats --port=8080 http://app.example.com/target/stats
$ curl localhost:8080/stats # => output
```
See also Docker Hub: [https://hub.docker.com/r/moznion/prom2jsond/](https://hub.docker.com/r/moznion/prom2jsond/)
How to build the binary
--
```
$ make build # bin/ has built binary
```
How to build the Docker container
--
```
$ make build-docker
```
Note
--
### Why execute the prom2json binary as external command?
In case of using prom2json as a library, that uses `log.Fatal` so it cannot control and recovery when occurs some errors (i.e. error occurs then daemon exits immediately). Thus this daemon executes the prom2json binary to make it be recoverable any errors.
License
--
Apache License 2.0