Comments (2)
I did it this way:
import { Registry } from '@digikare/nestjs-prom';
import { Header } from '@nestjs/common';
import { Controller, Get } from '@nestjs/common/';
import * as client from 'prom-client';
@Controller('metrics')
export class PromController {
private readonly _registry: Registry;
constructor(
private readonly promService: PromService,
) {
this._registry = this.promService.getDefaultRegistry();
}
@Get()
@Header('Content-Type', client.register.contentType)
public async index() {
return this._registry.metrics();
}
}
from nestjs-prom.
import {ApiTags} from "@nestjs/swagger";
import {PromController, PromModule} from "@digikare/nestjs-prom";
ApiTags('example')(PromController);
...
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
- PromCatchAllExceptionsFilter not compatible with GraphQL request HOT 9
- Add to the docs what is the unit of measurement for the http_requests_bucket
- 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.