Giter VIP home page Giter VIP logo

Comments (3)

mrzacarias avatar mrzacarias commented on June 14, 2024

Hi there @benbenedek, joining you on the group of people thankful for this great lib being open-sourced :)

About the communication with the prom agg gateway, I'm having no trouble with using a very simple post request using the registry.metrics() output as the payload:

  var xhr = new XMLHttpRequest()
  let metricsEndpoint = promGatewayURL + `/api/ui/metrics`;
  xhr.open('POST', metricsEndpoint, true)
  xhr.setRequestHeader("Content-Type", "text/plain;charset=UTF-8");
  xhr.addEventListener('load', () => {
    console.log(metricsEndpoint, "prometheus-gateway response", xhr.status, xhr.responseText);
  });
  xhr.send(promRegistry.metrics());

from promjs.

ngrkishore avatar ngrkishore commented on June 14, 2024

@mrzacarias , @benbenedek ,

What's promGatewayURL in the above code. Can you clarify if PromGateway should be running on server to make it work? I am using promjs library in Angular application. Not sure how to export these metrics so that they are available in "/metrics" endpoint. Please let me know how to do it.

from promjs.

jpellizzari avatar jpellizzari commented on June 14, 2024

@ngrkishore Yes the gateway needs to be running on the server. Prometheus does a request as an HTTP client, so it will not be able to scrape metrics in a browser.

Please see my response here: #24

Closing this issue.

from promjs.

Related Issues (20)

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.