-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: augment metrics with cid and cid+path counters #1429
Conversation
Deploying with
|
Latest commit: |
6afa2b7
|
Status: | ✅ Deploy successful! |
Preview URL: | https://80632ea2.nft-storage-1at.pages.dev |
530da8a
to
ea58d1f
Compare
ea58d1f
to
6c30005
Compare
Any suggestions for better naming for query type would be appreciated. Not super fan of it |
📎 It looks like we are trying to use prometheus to do the job of http access logs We should explore https://www.cloudflare.com/en-gb/products/cloudflare-logs/ and a http access log summary tool. |
6c30005
to
2a9ce81
Compare
Thanks for the feedback. I actually understood that I could get part of this metrics with Cloudflare Analytics. Currently using Cloudflare Analytics to obtain content type using https://github.com/nftstorage/cloudflare-analytics-prometheus-exporter/ and this PR will simply focus on query type. We already have a storage service for logs setup with Logtail and all the Logs go there. Sadly, they don't seem to offer any way of listening to the logtail source and parse inputs so that we can track metrics with a different app that exposes metrics to our Prometheus. They actually have a Grafana dashboard within Logtail, but we need to interact with the logs with SQL and it is quite complex to graph there rates of requests (for subdomain only) that are either CID or CID+Path format. Also, I would prefer to have everything in the same Grafana dashboard and just tracking here seems better than maintaining other service anyway. |
e884f4c
to
2f2d3c8
Compare
|
||
histogramCandidates.forEach((candidate) => { | ||
tmpHistogram[candidate] += 1 | ||
function getUpdatedHistogram(histogramData, histogramBuckets, value) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies for adding this refactor here 😬 I did the code because this PR already had MimeTypes histogram, but now I think we should keep it as it simplifies current histograms and if we add more in the future
2f2d3c8
to
6afa2b7
Compare
Closed in favour of nftstorage/nftstorage.link#15 as we moved gateway to new repo |
As part of nftstorage/nftstorage.link#18 this PR augments metrics with query type counter. Prometheus metrics look as follows: