Comments (3)
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.
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.
@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)
- Update NPM package HOT 1
- Add Summary support
- Using localStorage to keep registry state when page reloaded HOT 1
- Note non-standard path HOT 2
- Can't import as expected
- Angular HOT 1
- clear() obliterates metrics entirely? HOT 1
- Remove internal node modules directory HOT 1
- Update dependencies HOT 1
- Move from uglifyjs-webpack-plugin to terser-webpack-plugin
- Best practice for listening for changes to the metrics registry HOT 1
- Add default metrics
- Sending large payloads with 0 values after registry.reset() HOT 1
- Inspecting the registry to see if there are any metrics to push
- lodash usage contributes to ~71kb (minified) when targetting Cloudflare Workers runtime HOT 7
- Migrate CircleCI to GitHub Actions HOT 2
- Add .set method to gauges HOT 1
- Error when trying to run this package on react-native
- What's the status of this project? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from promjs.