Giter Site home page Giter Site logo

Comments (1)

gree-gorey avatar gree-gorey commented on June 12, 2024

No, right now scripts cannot be triggered by scrape -- in order to do so exporter needs a lot of changes in the code.
And for me it doesn't seem to be a good idea for 2 reasons:

  1. If you executing scripts on each request, your response time for a request becomes unpredictable or can be very long -- because script can take some time to execute and return results.
  2. This can lead to DoS and overload of exporter: imagine that several clients simultaneously wants to scrape from this exporter and it would have to execute a lot of scripts for each of them on-the-fly.

If you really need this setup I would suggest to just write a simple http server in any language you prefer (Go, Python, Java) that listen for incoming requests, and for each of them executing bash scripts and returning simple strings like:

mymetric{mylabel="myvalue"} 3.14
mymetric2{mylabel="myvalue"} 2.71

It would be just 20 lines of code in Python

from bash-exporter.

Related Issues (9)

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.