Giter Club home page Giter Club logo

openfaas-promq's Introduction

openfaas-promq

Build Status

OpenFaaS function that executes Prometheus queries

Usage

OpenFaaS

Deploy:

$ faas-cli deploy -f ./promq.yml --gateway=http://<GATEWAY-IP> 

Invoke:

$ echo -n '{"server": "http://prometheus.openfaas:9090", "query": "sum(increase(gateway_function_invocation_total[1h]))  by (function_name)", "start": "5 hours ago", "end": "now", "step": "1h","format": "table"}' | faas-cli invoke promq --gateway=<GATEWAY-IP>

       time| function_name:certinfo| function_name:nodeinfo
 1512293537|               0.000000|            1001.390821
 1512297137|               1.001391|            1001.390821
 1512300737|               0.000000|               0.000000
 1512304337|               0.000000|               9.000000
 1512307937|               2.000000|               0.000000
 1512311537|               3.004172|               3.004172

Parameters:

  • server: default http://prometheus.openfaas:9090 (can also be set with PROMETHEUS_URL environment variable)
  • query: promQL format
  • start: default 1 hour ago
  • end: default now
  • step: default 15s
  • format: table or json
{
  "server": "http://prometheus.openfaas:9090",
  "query": "sum(increase(gateway_function_invocation_total[1h]))  by (function_name)",
  "start": "5 hours ago",
  "end": "1 hour ago",
  "step": "1h",
  "format": "table"
}

openfaas-promq's People

Contributors

stefanprodan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.