Comments (9)
@lukasender I haven't completed a full integration with this module but I made some changes you can see here (https://github.com/chasevida/nestjs-prom/blob/feat/graphql/lib/prom-catch-all.exception-filter.ts) that enable integration with GraphQL.
Essentially, you have to check for the context and switch appropriately - in this case to a GQL Context. However, there may be some issues depending on how you setup you Nestjs GraphQL module. Also the Nestjs BaseExceptionFilter
integration is a little bit more nuanced and I haven't sorted out how this may work together so I've removed that in the case of a GraphQL request which may not be ideal depending on the rest of your setup.
Happy to turn this into a PR if there's any guidance on what else should be considered here.
from nestjs-prom.
On which version are you using?
Yes that's right, my module is only for http at the moment. I'll try to make it works with gql.
from nestjs-prom.
I needed it as well since it is swallowing up the real errors underneath, so i made a fork, did the code change by @chasevida, upgraded all dependencies to their latest version (most notably nestjs to v8) and committed the build artefacts. You can use it like this until this change is integrated in the main repo.
"@digikare/nestjs-prom": "roderik/nestjs-prom#master",
YMMV...
from nestjs-prom.
I use v1.0.0
Thanks for your feed back, and great work !
from nestjs-prom.
Is there a workaround for this? I'm getting the same error.
Thanks for your help in advance!
Great work! I'd love to keep using nestjs-prom! :)
from nestjs-prom.
Any updates on this?
from nestjs-prom.
@chasevida can you please submit PR for this
from nestjs-prom.
+1
from nestjs-prom.
Hi @kodeine, unfortunately I haven't had the time to come back around to this. I think @roderik may have a more up to date workaround. There's still a few things I would need to finalise and get direction on before I think this would be PR worthy. Specifically I need to come back and look at how BaseExceptionFilter
works and check the integration for that is compatible. Currently, I've removed it for GQL requests which is quite an opinionated decision that may or may not suit you - I need to check more on this.
from nestjs-prom.
Related Issues (20)
- defaultLabels does not work HOT 3
- can't set labelNames when getCounterMetric HOT 1
- When is ver 1.X scheduled to be released? HOT 9
- can't set metric name with @PromMethodCounter({ name: 'some_name' }) HOT 1
- version 1 is not available in npm HOT 1
- Add to the docs what is the unit of measurement for the http_requests_bucket
- how to use custom controller when withDefaultController: false HOT 2
- Example project
- FEAT: Programmatically hide Prometheus.metricPath from @nestjs/swagger output HOT 1
- RANDOMBYTESREQUEST when running a jest e2e test HOT 1
- can't use histogram without the labelNames and buckets HOT 2
- Use eslint over tslint
- Conflict with RXJS from nestjs
- Add example of running /metrics on a different port with nestjs
- Add option for custom controller
- Is this project still being maintained? HOT 2
- @PromMethodCounter() does not end up in /metrics HOT 1
- Fix compatibility with NestJS >= 8.0.0 HOT 3
- Property based injection for PromService doesn't work
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 nestjs-prom.