artmizu / nuxt-prometheus Goto Github PK
View Code? Open in Web Editor NEWPrometheus metrics for NodeJS and a set of custom metrics for Nuxt applications
Prometheus metrics for NodeJS and a set of custom metrics for Nuxt applications
Can you please add nuxt 2.16+ with bridge enabled into module constraints? When Nitro enabled, current version is working as expected, unlike @artmizu/analytics-nuxt-2
I encountered an Invariant Violation
when attempting to patch the fetch
module while using the this module. The error message indicates that the module has already been patched.
It seems like there's a conflict or a repeated attempt to patch the fetch
module within the interceptors setup. This issue appeared after updating to the latest version of the nuxt-prometheus
module.
Invariant Violation
Failed to patch the 'fetch' module: already patched.
This is my first time using prometheus, I think it's cool and useful,but i have some question.
first http://26.26.26.1:3000 is my local url
when i open http://26.26.26.1:3000/metrics,the web page look like this
and web page look like this when I open http://26.26.26.1:3000/health
but,i wanna web page like the image of README
what should I do
Nuxt 3.6.5
@artmizu/nuxt-prometheus: 2.1.3
I get the following error during npm install
or build
or dev
, etc.
Error while requiring module @artmizu/nuxt-prometheus: Error: Cannot find module '/home/runner/work/nuxt-prometheus/nuxt-prometheus/node_modules/.pnpm/[email protected]/node_modules/jiti/lib/index.js'
prom-client
has around 40kb overhead (https://bundlephobia.com/package/[email protected]), while it is perfectly fine for any Node.js deployment, worker builds especially can enjoy the bundle saving.
Since Prometheus format is super simple, we might replace it with an inline util that renders expected format for exported metrics.
hi,
maybe i am doing it wrong but could it be that /metrics is exposed to the internet? if so, is there a way to prevent that? i thought about a nuxt middleware but it seems that the metrics endpoint is intercepted way earlier, before getting to nuxt and therefore ignoring the middleware.
did i miss a setting?
I installed the module, then I realized that we did not need it. I then uninstalled the package. So now when I run 'npm run dev', I then get this message popping up several times every 15 seconds or so ' WARN [Vue Router warn]: No match found for location with path "/metrics". I have deleted the .nuxt folder, the pnpm-lock file, and the node_modules folder. I have removed the reference in the modules list in nuxt.config file. Then I ran pnpm install and npm run dev. And I still get this warning message.
Found invalid calculation of total requests time in your calculateTime
nuxt-prometheus/src/runtime/utils.ts
Line 3 in 7073d48
Ruined test cases are the second and last.
{
input: [
{ start: 1, end: 10 },
{ start: 5, end: 7 },
{ start: 15, end: 30 },
],
res: 24,
},
{
input: [
{ start: 100, end: 101 },
{ start: 100, end: 105 },
{ start: 95, end: 102 },
],
// 5 from function
res: 10,
},
{
input: [
{ start: 53, end: 55 },
{ start: 58, end: 78 },
{ start: 90, end: 95 },
],
res: 27,
},
{
input: [
{ start: 45, end: 75 },
{ start: 65, end: 75 },
{ start: 85, end: 90 },
],
res: 35,
},
{
input: [
{ start: 50, end: 75 },
{ start: 35, end: 55 },
{ start: 10, end: 15 },
{ start: 55, end: 60 },
],
// 25 from function
res: 45,
},
In the last test not sorted input, it possible if Object.values
return different ordered array in different js realizations
Thanks for cool module I was always thinking of exporting metrics for promotheus!
A quick review I found some issues:
configKey
seems is wrong analytics
while should probably be promotheus
in module definition and for runtime config (Line 15 in aac4b81
/_promotheus
(or at least _
) by default and provide options to customize or disable eachevent
object - it currently uses a deprecated method without node. prefix . And directly return response (
)Due to this issue in ofetch package @artmizu/nuxt-prometheus
cannot detect network requests which take place through useFetch or $fetch, because they both use ofetch inside. So on the /metrics page, you don't see any request time related to ofetch.
I've already tried:
Maybe someone has an idea of how to overcome the issue? Or we'll just wait for updates from ofetch
Hello,
I'm having the following error when adding the module to my nuxt 3 app :
Cannot find module './glossary' Require stack: - /[...]/@mswjs/interceptors
Is the module still working ?
Regards
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.