Sign inSign up

efernandezleon/postmetheus

By efernandezleon

Updated over 5 years ago

Tool to continuously check an API described in a Postman and exporting the metrics via Prometheus

Image
1

954

efernandezleon/postmetheus repository overview

PostMetheus

A tool for continuously checking an API described in a Postman collection and exporting the metrics via Prometheus.

The end goal of this tool:

  • Take advantage of the testing feature of Postman to use it as a Continuous Testing of APIs
  • Provide an easy way to periodically run this monitoring testing without external and more sophisticated tools like NewRelic
  • Expose the testing report as a Prometheus metrics in order to include them in your own monitoring and alert workflows

How to use:

  1. Define your Postman collection and include tests to verify the endpoints are working properly. To know more about how to write tests, you can head for official guideline. In addition, there are some samples of collections in the folder data to just to play around with this tool.

  2. Then, just run the container mounting a volume with the folder including the collection you want to monitor:

$ docker run \
    -e POSTMAN_COLLECTION=data/api_collection.json \
    -v /path/to/your/data:/usr/src/postmetheus/data \
    -p 8080:8080 \
    efernandezleon/postmetheus

The following list of environment variables can be used:

  • POSTMAN_COLLECTION: Used to specify a Postman collection file or URL

  • POSTMAN_ENVIRONMENT: Used to specify a Postman environment file or URL

  • WORKER_TIMER: Used to specify the frequency in seconds to run Newman

    This container will run periodically the newman tool and will expose the result via HTTP by using the Prometheus format.

  1. The script will launch a HTTP server listening to the port 8080, so you can access the path http://localhost:8080/metrics and see the different metrics in the Prometheus text format.

The metrics will include:

  • Number of failed tests for every endpoint.
  • If every single assertion for tests in every endpoint has passed or not.
  • Response time for endpoints.
  • Response size for endpoints.

More info

License

Tag summary

Content type

Image

Digest

Size

119.6 MB

Last updated

over 5 years ago

docker pull efernandezleon/postmetheus