|
Both can be easily implemented using I must point that the following grafana dashboard is preconfigured to visualize the metrics generated by service-tools https://grafana.com/grafana/dashboards/11159 Last, will open a ticket to adjust the chart at https://github.com/verdaccio/charts |
Replies: 12 comments 5 replies
|
I suggest create a middleware plugin for it so is used by demand. |
|
good point, I know little about plugin-middlewares It looks like a plugin needs to be imported manually via an npm command. Am I missing something? |
Yes, you might need extend verdaccio image, I'm not sure how k8s fully works. There are examples in our docker examples repo. |
|
@juanpicado Is there a way to register middleware before built-in endpoints? I mean for example when gathering duration metrics it is important to start timers as soon as possible. |
|
Currently not, but next major I was planning to add some sort of lifecycle so some actions can be triggered before and after. |
|
Thanks, I'm looking forward to it! |
|
Hello, I've published a Verdaccio plugin that adds basic Prometheus metrics, primarily for HTTP requests. It's available for installation here: https://www.npmjs.com/package/@freighthub/verdaccio-openmetrics and I hope to get the Github repo public relatively soon. I've found that middlewares are in front of the internal API in the express stack so the API requests (PUTs, etc) do show up. It seems possible to hack the express handler stack from within the plugin to put the metrics first in 4.x however I haven't seen that as super necessary so I haven't implemented that (meaning things like CORS requests are currently not reported). I'm also looking at what metrics can be emitted about the package database. It seems like 'average tarball size' isn't available, nor 'number of files in avg package' etc so not a ton to go from there. I'm open to suggestions though. Finally, if a Helm installation wants to configure these metrics, I'm like 90% sure you'd want to have a docker image with the metrics plugin included. Which seems like a pain point unless someday the official image includes a /metrics route. |
|
Thank you @danopia can't wait to see your package released. |
|
My plugin as mentioned above is now open source @ https://github.com/freight-hub/verdaccio-openmetrics I've relocated the published package to https://www.npmjs.com/package/verdaccio-openmetrics Hopefully others can find this useful. I am using a Dockerfile like this to create the image: FROM verdaccio/verdaccio:4.10
USER root
ENV NODE_ENV=production
RUN npm install --production \
&& npm install \
verdaccio-openmetrics@1.0.2 \
&& npm cache clean --force
USER verdaccio.. and then giving that image tag to Helm to be deployed. |
|
thank you so much - will definitely implement over the weekend. |
|
@danopia - cool plugin! For others involved in this discussion who are looking for Prometheus compatible metrics that are more focused on incoming requests and package downloads, XLTS.dev maintains the verdaccio-prometheus-middleware plugin. It is published to npm as well. We hope this can be useful to other Verdaccio users as well. |
My plugin as mentioned above is now open source @ https://github.com/freight-hub/verdaccio-openmetrics
I've relocated the published package to https://www.npmjs.com/package/verdaccio-openmetrics
Hopefully others can find this useful.
I am using a Dockerfile like this to create the image:
.. and then giving that image tag to Helm to be deployed.