{"_id":"@dreamit/graphql-prom-metrics","_rev":"6-e55e1fadbcd5cade50695eb34fd92c1f","name":"@dreamit/graphql-prom-metrics","dist-tags":{"latest":"1.3.0"},"versions":{"1.2.4":{"name":"@dreamit/graphql-prom-metrics","version":"1.2.4","keywords":["GraphQL","server","Prometheus","prom-client"],"author":{"name":"Stefan Gohlke"},"license":"MIT","_id":"@dreamit/graphql-prom-metrics@1.2.4","maintainers":[{"name":"a-team-dreamit","email":"ateam@dreamit.de"},{"name":"dreamit-mira","email":"mira@dreamit.de"}],"homepage":"https://github.com/dreamit-de/graphql-prom-metrics#readme","bugs":{"url":"https://github.com/dreamit-de/graphql-prom-metrics/issues"},"dist":{"shasum":"4cf094b769964322f308588e9222052eb4449c78","tarball":"https://registry.npmjs.org/@dreamit/graphql-prom-metrics/-/graphql-prom-metrics-1.2.4.tgz","fileCount":6,"integrity":"sha512-ai92EFJSkruBOY5sHajVjKbeHPh9KFnoPfUpgZrhMBrpzWB7J6fCAIBI3pzhJrV5Lt46ymPo8NJP0udHjk+CLg==","signatures":[{"sig":"MEUCIQCLHbIdctLdv5rlpw25jT6FN2yDxmkmkQ2cA0hUaYOuoAIgSqzRvIb6X6wHfBVS2G/T/XWugdfQMtjt+KtgmCXymZ8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@dreamit%2fgraphql-prom-metrics@1.2.4","provenance":{"predicateType":"https://slsa.dev/provenance/v0.2"}},"unpackedSize":16458},"main":"build/src/index.js","types":"build/src/index.d.ts","gitHead":"f08cb28df52354f653e05a288f5f7a73e1a37852","scripts":{"lint":"eslint src/*.ts tests/*.ts","test":"jest --runInBand","build":"tsc","check":"tsc --noEmit --pretty","lintfix":"eslint --fix src/*.ts tests/*.ts","prepack":"npm run build"},"_npmUser":{"name":"dreamit-mira","email":"mira@dreamit.de"},"repository":{"url":"git+https://github.com/dreamit-de/graphql-prom-metrics.git","type":"git"},"_npmVersion":"9.5.1","description":"MetricsClient for @dreamit/graphql-server using prom-client library","directories":{},"_nodeVersion":"18.16.1","_hasShrinkwrap":false,"devDependencies":{"express":"4.18.2","cross-fetch":"4.0.0","@types/express":"4.17.17","jest-html-reporters":"3.1.4","@dreamit/graphql-server":"4.2.4","@sgohlke/ts-base-dependencies":"1.0.15"},"peerDependencies":{"prom-client":"^14.0.1","@dreamit/graphql-server-base":"^1.0.0 || ^2.0.0"},"_npmOperationalInternal":{"tmp":"tmp/graphql-prom-metrics_1.2.4_1688719565769_0.636442050046427","host":"s3://npm-registry-packages"},"deprecated":"@dreamit/graphql-prom-metrics is deprecated and will no longer be maintained. Use at your own risk!"},"1.2.5":{"name":"@dreamit/graphql-prom-metrics","version":"1.2.5","keywords":["GraphQL","server","Prometheus","prom-client"],"author":{"name":"Stefan Gohlke"},"license":"MIT","_id":"@dreamit/graphql-prom-metrics@1.2.5","maintainers":[{"name":"a-team-dreamit","email":"ateam@dreamit.de"},{"name":"dreamit-mira","email":"mira@dreamit.de"}],"homepage":"https://github.com/dreamit-de/graphql-prom-metrics#readme","bugs":{"url":"https://github.com/dreamit-de/graphql-prom-metrics/issues"},"dist":{"shasum":"b838f1027fce63b2d1731613cd04b3795a469f64","tarball":"https://registry.npmjs.org/@dreamit/graphql-prom-metrics/-/graphql-prom-metrics-1.2.5.tgz","fileCount":6,"integrity":"sha512-N+HYTyOnGVyO2LZB1Q53dfjqudtdaca9bhlk8t3U6il1MlKL6M2FL2vsELrZZpMIRxCOZhxJFMqyjj9xHimQtQ==","signatures":[{"sig":"MEUCIC3mHnq/1bl6hbHoY18//IB18+eBYo8/j0y30JrcPjhdAiEAue7kbzICO0VYgx2L3uxxtS1ZiunRnyDJAY34ld0LibY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@dreamit%2fgraphql-prom-metrics@1.2.5","provenance":{"predicateType":"https://slsa.dev/provenance/v0.2"}},"unpackedSize":16458},"main":"build/src/index.js","types":"build/src/index.d.ts","gitHead":"ffb2c9b819fdb526708b78acc91c56a392c1574b","scripts":{"lint":"eslint src/*.ts tests/*.ts","test":"jest --runInBand","build":"tsc","check":"tsc --noEmit --pretty","lintfix":"eslint --fix src/*.ts tests/*.ts","prepack":"npm run build"},"_npmUser":{"name":"dreamit-mira","email":"mira@dreamit.de"},"repository":{"url":"git+https://github.com/dreamit-de/graphql-prom-metrics.git","type":"git"},"_npmVersion":"9.5.1","description":"MetricsClient for @dreamit/graphql-server using prom-client library","directories":{},"_nodeVersion":"18.16.1","_hasShrinkwrap":false,"devDependencies":{"express":"4.18.2","cross-fetch":"4.0.0","@types/express":"4.17.17","jest-html-reporters":"3.1.4","@dreamit/graphql-server":"4.2.5","@sgohlke/ts-base-dependencies":"1.0.16"},"peerDependencies":{"prom-client":"^14.0.1","@dreamit/graphql-server-base":"^1.0.0 || ^2.0.0"},"_npmOperationalInternal":{"tmp":"tmp/graphql-prom-metrics_1.2.5_1689623637020_0.5600547965803548","host":"s3://npm-registry-packages"},"deprecated":"@dreamit/graphql-prom-metrics is deprecated and will no longer be maintained. Use at your own risk!"},"1.2.6":{"name":"@dreamit/graphql-prom-metrics","version":"1.2.6","keywords":["GraphQL","server","Prometheus","prom-client"],"author":{"name":"Stefan Gohlke"},"license":"MIT","_id":"@dreamit/graphql-prom-metrics@1.2.6","maintainers":[{"name":"a-team-dreamit","email":"ateam@dreamit.de"},{"name":"dreamit-mira","email":"mira@dreamit.de"}],"homepage":"https://github.com/dreamit-de/graphql-prom-metrics#readme","bugs":{"url":"https://github.com/dreamit-de/graphql-prom-metrics/issues"},"dist":{"shasum":"f396f14f86e273cf6daa8a401570e29f3bb0b235","tarball":"https://registry.npmjs.org/@dreamit/graphql-prom-metrics/-/graphql-prom-metrics-1.2.6.tgz","fileCount":6,"integrity":"sha512-FZd5RvYFkeg1silM6AWQOAImjgbUJbK6pZ8phz3Xgj8sCqzmcLyV6r+KZ1gToAcOCboZ7orD0EwX06L2qxkFOA==","signatures":[{"sig":"MEUCIGlFh7cnxJIA8902MPtepHFudBZ5EQsQZvl47TLw9h58AiEAxUSodcfxwpfZRMPCEuFPXJ9vRNFgDxPixruK4Dzhm2M=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@dreamit%2fgraphql-prom-metrics@1.2.6","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":16765},"main":"build/src/index.js","types":"build/src/index.d.ts","gitHead":"6807f47dd7acedc9c76159acd647032b504000ac","scripts":{"lint":"eslint src/*.ts tests/*.ts","test":"jest --runInBand","build":"tsc","check":"tsc --noEmit --pretty","lintfix":"eslint --fix src/*.ts tests/*.ts","prepack":"npm run build"},"_npmUser":{"name":"dreamit-mira","email":"mira@dreamit.de"},"repository":{"url":"git+https://github.com/dreamit-de/graphql-prom-metrics.git","type":"git"},"_npmVersion":"9.8.1","description":"MetricsClient for @dreamit/graphql-server using prom-client library","directories":{},"_nodeVersion":"18.18.0","_hasShrinkwrap":false,"devDependencies":{"eslint":"8.51.0","ts-jest":"29.1.1","typescript":"5.2.2","@types/jest":"29.5.5","@types/node":"20.8.4","jest-html-reporters":"3.1.4","eslint-plugin-import":"2.28.1","eslint-plugin-unicorn":"48.0.1","eslint-plugin-security":"1.7.1","@dreamit/graphql-server":"4.2.8","@typescript-eslint/parser":"6.7.5","eslint-plugin-deprecation":"2.0.0","eslint-plugin-modules-newline":"0.0.6","@typescript-eslint/eslint-plugin":"6.7.5"},"peerDependencies":{"prom-client":"^14.0.0 || ^15.0.0","@dreamit/graphql-server-base":"^1.0.0 || ^2.0.0"},"_npmOperationalInternal":{"tmp":"tmp/graphql-prom-metrics_1.2.6_1697033979103_0.8227938305919711","host":"s3://npm-registry-packages"},"deprecated":"@dreamit/graphql-prom-metrics is deprecated and will no longer be maintained. Use at your own risk!"},"1.2.7":{"name":"@dreamit/graphql-prom-metrics","version":"1.2.7","keywords":["GraphQL","server","Prometheus","prom-client"],"author":{"name":"Stefan Gohlke"},"license":"MIT","_id":"@dreamit/graphql-prom-metrics@1.2.7","maintainers":[{"name":"a-team-dreamit","email":"ateam@dreamit.de"},{"name":"dreamit-mira","email":"mira@dreamit.de"}],"homepage":"https://github.com/dreamit-de/graphql-prom-metrics#readme","bugs":{"url":"https://github.com/dreamit-de/graphql-prom-metrics/issues"},"dist":{"shasum":"95ac17b114020291f6b95f29440bb5149b07d513","tarball":"https://registry.npmjs.org/@dreamit/graphql-prom-metrics/-/graphql-prom-metrics-1.2.7.tgz","fileCount":12,"integrity":"sha512-X+oycXtqZLggV4REeJT0AJ6/zNiLp13kY0iCLpWT4uNh2+inberm6Fj4y3SZP6wMnM/WUZ6CtKrkd09BZn/C5Q==","signatures":[{"sig":"MEYCIQDp0ndSeGIuuZtj4Ufc9LcN1l2Sq2GklCfq5DRw+cVkjAIhANA68L43WfmuHpwi4aSwy5KZ3MH5k/1zGRnQscSpqxL4","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@dreamit%2fgraphql-prom-metrics@1.2.7","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":27807},"main":"build/index.cjs","type":"module","types":"build/index.d.ts","module":"build/index.js","exports":{".":{"types":"./build/index.d.ts","import":"./build/index.js","default":"./build/index.js","require":"./build/index.cjs"},"./package.json":"./package.json"},"gitHead":"d870f07ef76a0910a2197b6713e79c7e9824b589","scripts":{"lint":"eslint src/*.ts tests/*.ts","test":"vitest","build":"tsup-node","check":"tsc --noEmit --pretty","format":"prettier --cache --write .","lintfix":"eslint --fix src/*.ts tests/*.ts","prepack":"npm run build","checkformat":"prettier --check ."},"_npmUser":{"name":"dreamit-mira","email":"mira@dreamit.de"},"repository":{"url":"git+https://github.com/dreamit-de/graphql-prom-metrics.git","type":"git"},"_npmVersion":"10.2.3","description":"MetricsClient for @dreamit/graphql-server using prom-client library","directories":{},"_nodeVersion":"20.10.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"8.0.1","eslint":"8.56.0","vitest":"1.2.1","prettier":"3.2.4","typescript":"5.3.3","@types/node":"20.11.5","vite-tsconfig-paths":"4.3.1","eslint-plugin-import":"2.29.1","eslint-plugin-unicorn":"50.0.1","eslint-plugin-security":"2.1.0","@dreamit/graphql-server":"4.5.0","@typescript-eslint/parser":"6.19.0","eslint-plugin-deprecation":"2.0.0","@typescript-eslint/eslint-plugin":"6.19.0"},"peerDependencies":{"prom-client":"^14.0.0 || ^15.0.0","@dreamit/graphql-server-base":"^1.0.0 || ^2.0.0"},"_npmOperationalInternal":{"tmp":"tmp/graphql-prom-metrics_1.2.7_1705961277965_0.9880627780280022","host":"s3://npm-registry-packages"},"deprecated":"@dreamit/graphql-prom-metrics is deprecated and will no longer be maintained. Use at your own risk!"},"1.3.0":{"name":"@dreamit/graphql-prom-metrics","version":"1.3.0","keywords":["GraphQL","server","Prometheus","prom-client"],"author":{"name":"Stefan Gohlke"},"license":"MIT","_id":"@dreamit/graphql-prom-metrics@1.3.0","maintainers":[{"name":"a-team-dreamit","email":"ateam@dreamit.de"},{"name":"dreamit-mira","email":"mira@dreamit.de"}],"homepage":"https://github.com/dreamit-de/graphql-prom-metrics#readme","bugs":{"url":"https://github.com/dreamit-de/graphql-prom-metrics/issues"},"dist":{"shasum":"6d2e8a932246405f70ebd868808848717516afb8","tarball":"https://registry.npmjs.org/@dreamit/graphql-prom-metrics/-/graphql-prom-metrics-1.3.0.tgz","fileCount":15,"integrity":"sha512-DynBQ8TKB8AA+RzWgwvmQpEpALM4JrF4+6DaZO4+EHcddNBZ5ympLwEoQBfNPu+5n+MfN9YuVRZrL2fbl7Cskg==","signatures":[{"sig":"MEQCIB+XRJ3iHq1LMi+GS/UohdrUVCCXX2QMEqc+ZaTLjMd8AiA2KwgPMlRl/8H2k2FT3xE3kyphHuyffz2L4AuPAIZpPw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@dreamit%2fgraphql-prom-metrics@1.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":33919},"main":"build/index.cjs","type":"module","types":"build/index.d.ts","module":"build/index.js","exports":{".":{"types":"./build/index.d.ts","import":"./build/index.js","default":"./build/index.js","require":"./build/index.cjs"},"./package.json":"./package.json"},"gitHead":"3f34015f16d96201d630be00c83ac17df4185dfd","scripts":{"lint":"oxlint -c .oxlintrc.json","test":"vitest run --coverage","build":"tsup-node","check":"tsc --noEmit --pretty","format":"prettier --cache --write .","lintfix":"oxlint -c .oxlintrc.json --fix","prepack":"npm run build","checkformat":"prettier --check ."},"_npmUser":{"name":"dreamit-mira","email":"mira@dreamit.de"},"repository":{"url":"git+https://github.com/dreamit-de/graphql-prom-metrics.git","type":"git"},"_npmVersion":"10.8.2","description":"MetricsClient for @dreamit/graphql-server using prom-client library","directories":{},"_nodeVersion":"20.19.1","_hasShrinkwrap":false,"devDependencies":{"tsup":"8.5.0","oxlint":"0.16.11","vitest":"3.1.4","prettier":"3.5.3","@swc/core":"1.11.24","typescript":"5.8.3","@types/node":"20.11.5","@vitest/coverage-v8":"3.1.4","vite-tsconfig-paths":"5.1.4","@dreamit/graphql-server":"5.0.1","@dreamit/graphql-testing":"1.0.1","prettier-plugin-organize-imports":"4.1.0"},"peerDependencies":{"prom-client":"^14.0.0 || ^15.0.0","@dreamit/graphql-server-base":"^1.0.0 || ^2.0.0 || ^3.0.0"},"_npmOperationalInternal":{"tmp":"tmp/graphql-prom-metrics_1.3.0_1747758650347_0.342781695916339","host":"s3://npm-registry-packages-npm-production"},"deprecated":"@dreamit/graphql-prom-metrics is deprecated and will no longer be maintained. Use at your own risk!"}},"time":{"created":"2023-07-07T08:46:05.717Z","modified":"2025-07-01T12:02:46.947Z","1.2.4":"2023-07-07T08:46:05.927Z","1.2.5":"2023-07-17T19:53:57.188Z","1.2.6":"2023-10-11T14:19:39.329Z","1.2.7":"2024-01-22T22:07:58.129Z","1.3.0":"2025-05-20T16:30:50.521Z"},"bugs":{"url":"https://github.com/dreamit-de/graphql-prom-metrics/issues"},"author":{"name":"Stefan Gohlke"},"license":"MIT","homepage":"https://github.com/dreamit-de/graphql-prom-metrics#readme","keywords":["GraphQL","server","Prometheus","prom-client"],"repository":{"url":"git+https://github.com/dreamit-de/graphql-prom-metrics.git","type":"git"},"description":"MetricsClient for @dreamit/graphql-server using prom-client library","maintainers":[{"name":"a-team-dreamit","email":"ateam@dreamit.de"},{"name":"dreamit-mira","email":"mira@dreamit.de"}],"readme":"# graphql-prom-metrics\n\nMetricsClient for @dreamit/graphql-server using prom-client library.\n\n## Installation\n\n```sh\nnpm install --save @dreamit/graphql-prom-metrics\n```\n\nTypeScript declarations are provided within the project.\n\n## Compatibility\n\n**graphql-prom-metrics** is compatible with [@dreamit/graphql-server][1] version ^3.2.1 and [prom-client][2] version ^14.0.1.\n\n## Features\n\n- Provides out-of-the-box metrics for GraphQLServer\n- Provides 3 custom as well as NodeJS related metrics.\n- Uses only 2 peerDependencies: [@dreamit/graphql-server][1] version 3 and [prom-client][2] version 14 (no other production\n  dependencies)\n\n## Metrics\n\nThe **PromMetricsClient** uses [prom-client][2] library to provide NodeJS metrics like cpu and memory usage as well as GraphQLServer related metrics.\n\n**Warning!**:\nIf you are using **PromMetricsClient** you should avoid creating multiple **GraphQLServer** instances that all use the **PromMetricsClient**. Because of the usage of a global object in the [prom-client][2] library this might result in unexpected behaviour or malfunction. You can set another metrics client like **SimpleMetricsClient** by calling **GraphQLServer setOptions()** or **GraphQLServer setMetricsClient()**.\n\nThe **PromMetricsClient** provides three custom metrics for the GraphQL server:\n\n- **graphql_server_availability**: Availability gauge with status 0 (unavailable) and 1 (available)\n- **graphql_server_request_throughput**: The number of incoming requests\n- **graphql_server_errors**: The number of errors that are encountered while running the GraphQLServer. The counter uses\n  the _errorName_ field as label so errors could be differentiated. At the moment the following labels are available and\n  initialized with 0:\n    - FetchError\n    - GraphQLError\n    - SchemaValidationError\n    - MethodNotAllowedError\n    - InvalidSchemaError\n    - MissingQueryParameterError\n    - ValidationError\n    - SyntaxError\n    - IntrospectionDisabledError\n\nA simple metrics endpoint can be created by using `getMetricsContentType` and `getMetrics` functions from\nthe `GraphQLServer` instance. In the example below a second route is used to return metrics data.\n\n```typescript\nconst graphQLServerPort = 3592\nconst graphQLServerExpress = express()\nconst customGraphQLServer = new GraphQLServer({\n    schema: someExampleSchema,\n    metricsClient: new PromMetricsClient(),\n})\ngraphQLServerExpress.use(bodyParser.text({ type: '*/*' }))\ngraphQLServerExpress.all('/graphql', (req, res) => {\n    return customGraphQLServer.handleRequestAndSendResponse(req, res)\n})\ngraphQLServerExpress.get('/metrics', async (req, res) => {\n    return res\n        .contentType(customGraphQLServer.getMetricsContentType())\n        .send(await customGraphQLServer.getMetrics())\n})\ngraphQLServerExpress.listen({ port: graphQLServerPort })\nconsole.info(`Starting GraphQL server on port ${graphQLServerPort}`)\n```\n\n## Contact\n\nIf you have questions or issues please visit our [Issue page](https://github.com/dreamit-de/graphql-prom-metrics/issues)\nand open a new issue if there are no fitting issues for your topic yet.\n\n## License\n\ngraphql-server is under [MIT-License](./LICENSE).\n\n[1]: https://github.com/dreamit-de/graphql-server\n[2]: https://github.com/siimon/prom-client\n","readmeFilename":"README.md"}