Skip to content
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 #15

Closed
wants to merge 1 commit into from

Conversation

vasco-santos
Copy link
Contributor

@vasco-santos vasco-santos commented Apr 7, 2022

As part of #18 this PR augments metrics with query type counter. Prometheus metrics look as follows:


# HELP nftgateway_responses_by_query_type_total total of responses by query status. Either CID or CID+PATH.
# TYPE nftgateway_responses_by_query_type_total counter
nftgateway_responses_by_query_type_total{env="test",type="CID"} 1
nftgateway_responses_by_query_type_total{env="test",type="CID+PATH"} 1

Moved from nftstorage/nft.storage#1429

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Apr 7, 2022

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: aacce49
Status: ✅  Deploy successful!
Preview URL: https://1a4e12f7.nftstorage-link.pages.dev

View logs

@vasco-santos vasco-santos changed the title feat: augment metrics mime type feat: augment metrics with cid and cid+path counters Apr 7, 2022
@vasco-santos vasco-santos force-pushed the feat/augment-metrics-mime-type branch from 65f8482 to aacce49 Compare April 7, 2022 12:37
default:
return new Response('Not found', { status: 404 })
throw new Error('Not found')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How come this change? I expect a 500 to be returned in the response now but 404 was more accurate.

@@ -4,19 +4,23 @@ import {
} from '../utils/histogram.js'

/**
* @typedef {'CID'|'CID+PATH'} QueryType

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd maybe not use "CID" here since IPNS keys are CIDs too. Maybe something like:

  • IPFS direct
  • IPFS pathed
  • IPNS direct
  • IPNS pathed

@vasco-santos
Copy link
Contributor Author

Done in reads pipeline with Loki

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants