All Projects → hudeldudel → postman-exporter

hudeldudel / postman-exporter

Licence: Apache-2.0 license
Postman exporter for Prometheus

Programming Languages

javascript
184084 projects - #8 most used programming language
Dockerfile
14818 projects

Projects that are alternatives of or similar to postman-exporter

my-demo
Demo Application for Dubbo, Mycat, Sharding-Proxy, Seata, SkyWalking, PinPoint, ZipKin, Docker, Kubernetes, Istio, Postman/Newman, FitNesse
Stars: ✭ 37 (+184.62%)
Mutual labels:  postman, newman
Newman-to-Slack
Runs a Newman test script and outputs the summary to a Slack webhook
Stars: ✭ 26 (+100%)
Mutual labels:  postman, newman
NewmanPostman VSTS Task
A task for Azure DevOps Pipelines to run newman tests.
Stars: ✭ 31 (+138.46%)
Mutual labels:  postman, newman
awesome-newman-html-template
😎 A newman html report very detailed
Stars: ✭ 63 (+384.62%)
Mutual labels:  postman, newman
Newman
Newman is a command-line collection runner for Postman
Stars: ✭ 5,607 (+43030.77%)
Mutual labels:  postman, newman
monitor-man
HTTP API monitor based on postman and newman.
Stars: ✭ 44 (+238.46%)
Mutual labels:  postman, newman
postman-runtime
www.postman.com/downloads
Stars: ✭ 160 (+1130.77%)
Mutual labels:  postman
phdevsdir
WIP: A Directory app for web devs in Port Harcourt, Nigeria. Built with React and Express
Stars: ✭ 14 (+7.69%)
Mutual labels:  postman
kb-proxy
kb-proxy 是一个可本地部署的、提供代理功能、接口测试管理、支持在线Mock、Host环境管理的在线工具平台。
Stars: ✭ 52 (+300%)
Mutual labels:  postman
reky
Reky is an opensource API development platform. It automatically visualizes API response with outstanding graphs & tables.
Stars: ✭ 22 (+69.23%)
Mutual labels:  postman
phalcon-micro-rest-api-skeleton
This is a basic API REST skeleton written on Phalcon PHP. Great For building an MVP for your frontend app (Vue, react, angular, or anything that can consume an API)
Stars: ✭ 57 (+338.46%)
Mutual labels:  postman
postman-collections
Postman collections for HERE REST APIs.
Stars: ✭ 127 (+876.92%)
Mutual labels:  postman
media-api-samples
Sample Code | Media APIs | Dolby.io
Stars: ✭ 20 (+53.85%)
Mutual labels:  postman
postman-webex
Postman collections for Webex REST APIs
Stars: ✭ 97 (+646.15%)
Mutual labels:  postman
jersey-jwt-springsecurity
Example of REST API with JWT authentication using Spring Boot, Spring Security, Jersey and Jackson.
Stars: ✭ 44 (+238.46%)
Mutual labels:  postman
pcs-postman
Postman collections for Prisma Cloud
Stars: ✭ 42 (+223.08%)
Mutual labels:  postman
laravel-api
A repository containing a starter kit that can help you develop api in your Laravel applications.
Stars: ✭ 25 (+92.31%)
Mutual labels:  postman
postman-to-markdown
Generate documentation in markdown from postman documentation.
Stars: ✭ 30 (+130.77%)
Mutual labels:  postman
postpython
Postman collection runner library for python
Stars: ✭ 44 (+238.46%)
Mutual labels:  postman
httpyac
Command Line Interface for *.http and *.rest files. Connect with http, gRPC, WebSocket and MQTT
Stars: ✭ 103 (+692.31%)
Mutual labels:  postman

Postman Exporter

The postman exporter allows blackbox probing with Prometheus using Postman collections.

Motivation

There are several exporters available for collecting metrics with Prometheus. Most of it focus on providing whitebox metrics. The Prometheus blackbox exporter already allows probing of endpoints over HTTP, HTTPS, DNS, TCP and ICMP. However, it is complex or sometimes impossible to probe more sophisticated sequences of HTTP/HTTPS requests and validate its responses.

The postman exporter aims to be able to carry even complex test procedures. These should be easy to create with the widely used Postman Platform for API Development. It uses Newman (as library) to run Postman collections and provides metrics about that execution.

Getting Started

Prerequisites:

Install:

Run:

  • Run npm start in the project folder to start the service.
    By default it will listen on port 3000.

Configuration

The configuration consists of two parts.

  1. Setup the exporter
  2. Setup Prometheus to scrape postman exporter targets

Postman Exporter Configuration

Probe configuration

Edit the configuration file config/probes.js to fit to your needs.

A Postman collection and associated options are combined to form a probe. Several probes can be configured to make them available via the /probes endpoint.

See also newman run options for details on the options available.

Example:

module.exports = {
  // Each probe requires a Postman collection and allows for additional options. 
  // Execute by requesting /probe/<probe_name>

  // Probe name
  // <probe_name>
  // String of non-registered URL characters (A–Z, a–z, 0-9, -._~)
  "example": {

      // see newman documentation for all available parameters
      // https://github.com/postmanlabs/newman#newmanrunoptions-object--callback-function--run-eventemitter
      options: {
          collection: require('./example.json')
      },
      // Optional: Set labels that will be added to all probe metrics.
      customLabels: {
          example_label: "example_label_value",
          another_example_label: "another value"
      }
  },

  "example2": {
      options: {
          collection: require('./eample2-collection.json'),
          environment: require('./example2-environment.json'),
          sslClientCert: __dirname + '/' + 'cert.pem',
          sslClientKey: __dirname + '/' + 'key.pem',
          timeoutRequest: 2000,
          folder: 'myFolder'
      }
  }
};

Service configuration

Service configuration is available via configuration file config/config.js or environment variables:

  • POSTMAN_BLACKBOX_EXPORTER_PORT
    Network port to bind to.
    Default: 3000
  • POSTMAN_BLACKBOX_EXPORTER_TIMEOUT
    Server timeout in milliseconds.
    Default: 120000
    If necessary, think about adjusting the scrape timeout also in Prometheus.
  • POSTMAN_BLACKBOX_EXPORTER_LOGLEVEL
    Loglevel (debug|info|warn|error).
    Default: info
  • POSTMAN_BLACKBOX_EXPORTER_PROBE_CONFIG_FILE
    Path to probe configuration file.
    Default: config/probes.js
  • POSTMAN_BLACKBOX_EXPORTER_PROBE_DEBUG
    Allow/disallow (true|false) probe debug mode.
    ! Debug output may expose secrets contained in requests/responses, etc.. !
    Default: false

Prometheus Configuration

To scrape the probes, follow the multi-target exporter pattern and use relabeling.

Example:

scrape_configs:
  - job_name: 'postman-exporter'
    scrape_interval: 1m
    scrape_timeout: 10s
    scheme: http
    metrics_path: /probe
    static_configs:
    - targets:
      - example
    relabel_configs:
    - source_labels: [__address__]
      target_label: probe
    - source_labels: [__metrics_path__,__address__]
      separator: '/'
      target_label: __metrics_path__
    - target_label: __address__
      replacement: monitoring-postman-exporter

Endpoints

  • GET /
    Display overview page

  • GET /probe/:probe[?debug=true]
    Run probe and show metrics
    Parameters:
    probe: (required) the probe to run. E. g. /probe/example
    Arguments:
    ?debug=true: (optional) If added, newmans run summary object is returned instead of metrics. Probe debug also needs to be enabled in configuration.

  • GET /config
    Show active configuration

  • GET /metrics
    Node.js server metrics

  • GET /-/ready
    Returns status code 200 when the service is running

Metrics

Run with Docker

  • Build
    • docker build -t postman-exporter .
  • Run for tests
    • docker run --rm -p 3000:3000 postman-exporter
  • Sample usage (some.json - your collection)
    • docker run -d --restart=always -p 3000:3000 -v $(PWD)/some.json:/app/config/example.json postman-exporter

Example Grafana Dashboard

tbd

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].